dmvk commented on a change in pull request #18626:
URL: https://github.com/apache/flink/pull/18626#discussion_r799539061



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/dispatcher/Dispatcher.java
##########
@@ -1119,7 +1158,11 @@ private void jobMasterFailed(JobID jobId, Throwable 
cause) {
 
     private void registerDispatcherMetrics(MetricGroup jobManagerMetricGroup) {
         jobManagerMetricGroup.gauge(
-                MetricNames.NUM_RUNNING_JOBS, () -> (long) 
jobManagerRunnerRegistry.size());
+                MetricNames.NUM_RUNNING_JOBS,
+                // metrics can be called from anywhere and therefore, have to 
run without the main
+                // thread safeguard being triggered. For metrics, we can 
afford to be not 100%
+                // accurate

Review comment:
       👍 
   
   https://github.com/apache/flink/pull/18566#discussion_r799532804




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to