pnowojski commented on a change in pull request #18702:
URL: https://github.com/apache/flink/pull/18702#discussion_r803730641



##########
File path: 
flink-streaming-java/src/test/java/org/apache/flink/streaming/api/operators/source/CollectingDataOutput.java
##########
@@ -47,11 +47,16 @@ public void emitWatermarkStatus(WatermarkStatus 
watermarkStatus) throws Exceptio
 
     @Override
     public void emitRecord(StreamRecord<E> streamRecord) throws Exception {
-        events.add(streamRecord);
+        // Bypass issues with object re-use disabled by copying the record
+        events.add(streamRecord.copy(streamRecord.getValue()));

Review comment:
       `StreamRecord` instance is being re-used by the sources. While this 
`CollectingDataOutput` is collecting them. So `CollectingDataOutput` passed to 
a source that two emitted different records, would first emit end up with 
`events` list having two entries pointing to the same `StreamRecord` instance 
with the same value. The secondly emitted record would replace the previously 
collected value :(




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to