Github user tillrohrmann commented on a diff in the pull request:
https://github.com/apache/flink/pull/5504#discussion_r168735497
--- 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 --
Hmm, I actually would like to avoid that people can introduce blocking
operations into the `ClusterEntrypoint`, for example. By offering a blocking
`shutdown` method, I fear that this can easily happen again.
---