tillrohrmann closed pull request #6971: [FLINK-9552][iterations] fix not 
syncing on checkpoint lock before emitting records
URL: https://github.com/apache/flink/pull/6971
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamIterationHead.java
 
b/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamIterationHead.java
index c54235cc349..ecef7f0f207 100644
--- 
a/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamIterationHead.java
+++ 
b/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamIterationHead.java
@@ -76,8 +76,10 @@ protected void run() throws Exception {
 
                        // If timestamps are enabled we make sure to remove 
cyclic watermark dependencies
                        if (isSerializingTimestamps()) {
-                               for (RecordWriterOutput<OUT> output : outputs) {
-                                       output.emitWatermark(new 
Watermark(Long.MAX_VALUE));
+                               synchronized (getCheckpointLock()) {
+                                       for (RecordWriterOutput<OUT> output : 
outputs) {
+                                               output.emitWatermark(new 
Watermark(Long.MAX_VALUE));
+                                       }
                                }
                        }
 
@@ -87,8 +89,10 @@ protected void run() throws Exception {
                                        dataChannel.take();
 
                                if (nextRecord != null) {
-                                       for (RecordWriterOutput<OUT> output : 
outputs) {
-                                               output.collect(nextRecord);
+                                       synchronized (getCheckpointLock()) {
+                                               for (RecordWriterOutput<OUT> 
output : outputs) {
+                                                       
output.collect(nextRecord);
+                                               }
                                        }
                                }
                                else {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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

Reply via email to