zentol commented on code in PR #24309: URL: https://github.com/apache/flink/pull/24309#discussion_r1488731829
########## flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/FineGrainedSlotManager.java: ########## @@ -594,18 +597,19 @@ private void checkResourceRequirementsWithDelay() { if (requirementsCheckDelay.toMillis() <= 0) { checkResourceRequirements(); } else { - if (requirementsCheckFuture == null || requirementsCheckFuture.isDone()) { - requirementsCheckFuture = new CompletableFuture<>(); - scheduledExecutor.schedule( - () -> - mainThreadExecutor.execute( - () -> { - checkResourceRequirements(); - Preconditions.checkNotNull(requirementsCheckFuture) - .complete(null); - }), - requirementsCheckDelay.toMillis(), - TimeUnit.MILLISECONDS); + if (requirementsCheckFuture.isDone()) { + requirementsCheckFuture = + scheduledExecutor.schedule( + () -> { + if (started) { Review Comment: This read is unsafe since `started` isn't volatile. -- 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