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



##########
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:
       I named the variable 'suspended' but it looks like it's better to have a 
name that represents the running state rather than stopping because in all 
places we check only that the loop is running. But the best name is 
loopRunning(or something like that) which already booked by existed variable 
mailboxLoopRunning so if we don't want to change that name(mailboxLoopRunning) 
then 'suspended' is also ok for me.




-- 
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:
[email protected]


Reply via email to