pnowojski commented on a change in pull request #9383: [FLINK-13248] [runtime]
Adding processing of downstream messages in AsyncWaitOperator's wait loops
URL: https://github.com/apache/flink/pull/9383#discussion_r318419434
##########
File path:
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/mailbox/execution/MailboxProcessor.java
##########
@@ -106,33 +109,37 @@ public void open() {
* Lifecycle method to close the mailbox for action submission.
*/
public void prepareClose() {
- mailboxExecutor.shutdown();
+ mailbox.quiesce();
}
/**
* Lifecycle method to close the mailbox for action
submission/retrieval. This will cancel all instances of
* {@link java.util.concurrent.RunnableFuture} that are still contained
in the mailbox.
*/
public void close() {
- List<Runnable> droppedLetters = mailboxExecutor.shutdownNow();
+ List<Runnable> droppedLetters = mailbox.close();
if (!droppedLetters.isEmpty()) {
LOG.debug("Closing the mailbox dropped letters {}.",
droppedLetters);
FutureUtils.cancelRunnableFutures(droppedLetters);
}
}
+ private boolean isMailboxThread() {
+ return Thread.currentThread() == mailboxThread;
+ }
+
/**
* Runs the mailbox processing loop. This is where the main work is
done.
*/
public void runMailboxLoop() throws Exception {
Preconditions.checkState(
- mailboxExecutor.isMailboxThread(),
+ isMailboxThread(),
Review comment:
nit: formatting?
----------------------------------------------------------------
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]
With regards,
Apache Git Services