JunRuiLee commented on code in PR #23447:
URL: https://github.com/apache/flink/pull/23447#discussion_r1429717030


##########
flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/metrics/MetricStore.java:
##########
@@ -126,9 +140,14 @@ public synchronized void 
updateCurrentExecutionAttempts(Collection<JobDetails> j
                                                             
taskMetricStore.getSubtaskMetricStore(
                                                                     
subtaskIndex))
                                             .ifPresent(
-                                                    subtaskMetricStore ->
-                                                            
subtaskMetricStore.retainAttempts(
-                                                                    
attempts.getCurrentAttempts()));
+                                                    subtaskMetricStore -> {
+                                                        
subtaskMetricStore.retainAttempts(

Review Comment:
   Thanks for clarification @X-czh .
   
   I'm not quite certain I understand your concern.
   In my opinion, this issue is unrelated to the web interface and more related 
to the inconsistency in the MetricStore because the WebUI is also get data from 
MetricStore. Specifically, the metrics in the subtaskMetricsStore are being 
removed, while the metrics in the taskMetricsStore are not synchronously 
removed, which could be confusing for users.
   
   Based on your changes, you can perform the following test:
   For a jobVertex that has already finished, you can use the 
JobVertexMetricsHandler to retrieve subtask metrics like below:
   
http://localhost:8081/jobs//vertices//metrics?get=0.backPressuredTimeMsPerSecond,0.busyTimeMsPerSecond
   Then, compare the results with the SubtaskMetricsHandler:
   
http://localhost:8081/jobs//vertices//subtasks/0/metrics?get=backPressuredTimeMsPerSecond,busyTimeMsPerSecond
   
   The results from these two endpoints are different. In my local test, the 
results are as shown in the attached image. I prefer that cleaning up should be 
done simultaneously for both, WDYT?
   
   
![image](https://github.com/apache/flink/assets/107924572/7ecdf3a0-f9ca-4ddf-aadd-a5d6a684f7f9)
   



-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to