mirror of https://github.com/apache/kafka.git
MINOR: pass in timeout to Admin.close() (#16422)
Reviewers: Luke Chen <showuon@gmail.com>, Kamal Chandraprakash <kamal.chandraprakash@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>, Apoorv Mittal <amittal@confluent.io>, Bruno Cadonna <bruno@confluent.io>
This commit is contained in:
parent
3ebad6349d
commit
dc7c9ad068
|
@ -1514,7 +1514,13 @@ public class KafkaStreams implements AutoCloseable {
|
|||
}
|
||||
|
||||
stateDirectory.close();
|
||||
adminClient.close();
|
||||
// passing in `timeoutMs` here is a quick fix to avoid blocking forever
|
||||
// cf https://issues.apache.org/jira/browse/KAFKA-7996
|
||||
if (timeoutMs >= 0) {
|
||||
adminClient.close(Duration.ofMillis(timeoutMs));
|
||||
} else {
|
||||
adminClient.close();
|
||||
}
|
||||
|
||||
streamsMetrics.removeAllClientLevelSensorsAndMetrics();
|
||||
metrics.close();
|
||||
|
|
Loading…
Reference in New Issue