pnowojski commented on a change in pull request #15375:
URL: https://github.com/apache/flink/pull/15375#discussion_r604808355



##########
File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/mailbox/MailboxProcessor.java
##########
@@ -79,9 +79,19 @@
      */
     protected final MailboxDefaultAction mailboxDefaultAction;
 
-    /** Control flag to terminate the mailbox loop. Must only be accessed from 
mailbox thread. */
+    /**
+     * Control flag to terminate the mailbox loop. Once it was terminated 
could not be restarted
+     * again. Must only be accessed from mailbox thread.
+     */
     private boolean mailboxLoopRunning;
 
+    /**
+     * Control flag to terminate the current mailbox loop. This allows to 
interrupt the suspendable
+     * loop even if not all actions were completed. This flag can be restarted 
as many times as
+     * {@link #mailboxLoopRunning} is active. Must only be accessed from 
mailbox thread.
+     */
+    private boolean suspendableMailboxLoopRunning;

Review comment:
       rename and invert to `private boolean suspended`?

##########
File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/mailbox/MailboxProcessor.java
##########
@@ -457,4 +495,18 @@ private void resumeInternal() {
             }
         }
     }
+
+    /** Isolated API for providing an opportunity to run the mailbox loop 
which can be suspended. */
+    public final class SuspendableMailboxLoop {

Review comment:
       Maybe we can drop this class? And either move `suspend()` to 
`MailboxProcessor` or to 
`org.apache.flink.streaming.runtime.tasks.mailbox.MailboxDefaultAction.Controller`?




-- 
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.

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


Reply via email to