1u0 commented on a change in pull request #9717: [FLINK-14044] [runtime]
Reducing synchronization in AsyncWaitOperator
URL: https://github.com/apache/flink/pull/9717#discussion_r328246338
##########
File path:
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/async/AsyncFunction.java
##########
@@ -89,6 +89,7 @@
/**
* {@link AsyncFunction#asyncInvoke} timeout occurred.
* By default, the result future is exceptionally completed with a
timeout exception.
+ * Note that timeout and asyncInvoke might be invoked at the same time.
Review comment:
This method is currently supposed to be called in the task's main thread. It
may happen that the timer would be triggered during `asyncInvoke()` call.
But (with the current changes in the `master` branch) the trigger itself
won't call the `timeout()`, it would just post a mailbox letter to delegate the
call to the task's main thread.
Before, this comment made sense, because both methods were called from
different (independent) threads.
From API usage point of view, the `asyncInvoke()` is supposed to be
"lightweight", it should initiate an actual asynchronous operation (maybe using
some user defined execution pool) and give control back. Otherwise, it won't
differ from normal "flat map" operator and would block the task's progress.
----------------------------------------------------------------
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