[
https://issues.apache.org/jira/browse/FLINK-8670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16366885#comment-16366885
]
ASF GitHub Bot commented on FLINK-8670:
---------------------------------------
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.
> Make MetricRegistryImpl#shutdown non blocking
> ----------------------------------------------
>
> Key: FLINK-8670
> URL: https://issues.apache.org/jira/browse/FLINK-8670
> Project: Flink
> Issue Type: Improvement
> Components: Metrics
> Affects Versions: 1.5.0
> Reporter: Till Rohrmann
> Assignee: Till Rohrmann
> Priority: Major
> Labels: flip-6
> Fix For: 1.5.0
>
>
> In order to better shut down multiple components concurrently, we should make
> all shutdown operation non-blocking if possible. This also includes the
> {{MetricRegistryImpl}}.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)