X-czh commented on code in PR #23447: URL: https://github.com/apache/flink/pull/23447#discussion_r1429759033
########## 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: Hi @JunRuiLee, thanks for the clarification. I get your point and my concern is actual about maintainability of the code in the future. When there're both insertion and deletion operations, the duplication of task-level metrics actually makes it more difficult to maintain consistency (as is the case here), so I think it would be better to optimize the duplication issue here in the future. I'll clean up simultaneously for both cases first here, and create a new issue for the optimization later. WDYT? -- 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