1u0 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_r315124537
##########
File path:
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/async/Emitter.java
##########
@@ -97,22 +102,18 @@ public void run() {
}
}
- private void output(AsyncResult asyncResult) throws
InterruptedException {
+ /**
+ * Executed as a mail in the mailbox thread. Output needs to be guarded
with checkpoint lock (for the time being).
+ *
+ * @param asyncResult the result to output.
+ */
+ private void output(AsyncResult asyncResult) {
if (asyncResult.isWatermark()) {
- synchronized (checkpointLock) {
- AsyncWatermarkResult asyncWatermarkResult =
asyncResult.asWatermark();
+ AsyncWatermarkResult asyncWatermarkResult =
asyncResult.asWatermark();
Review comment:
This action can be executed by a normal mailbox loop (not the one running in
`AsyncWaitOperator` via `yieldToDownstream()`), that doesn't run letters under
checkpoint lock (yet).
Also, I think you are losing guarantee, that this operation and
`streamElementQueue.poll()` happen atomically.
It may happen, that task checkpoint, then restart and restore would emit
duplicate events.
----------------------------------------------------------------
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