Github user zentol commented on a diff in the pull request:
https://github.com/apache/flink/pull/5504#discussion_r168728890
--- Diff:
flink-runtime/src/main/java/org/apache/flink/runtime/metrics/MetricRegistryImpl.java
---
@@ -226,71 +235,72 @@ public int getNumberReporters() {
*/
public boolean isShutdown() {
synchronized (lock) {
- return reporters == null && executor.isShutdown();
+ return isShutdown;
}
}
/**
* Shuts down this registry and the associated {@link MetricReporter}.
+ *
+ * <p>NOTE: This operation is asynchronous and returns a future which
is completed
+ * once the shutdown operation has been completed.
+ *
+ * @return Future which is completed once the {@link MetricRegistryImpl}
+ * is shut down.
*/
- public void shutdown() {
+ public CompletableFuture<Void> shutdown() {
--- End diff --
How about renaming this to shutdownAsync? (and possible keep shutdown()
that just calls shutdownAsync().get()).
---