spuru9 commented on code in PR #28474:
URL: https://github.com/apache/flink/pull/28474#discussion_r3967966455


##########
flink-streaming-java/src/test/java/org/apache/flink/streaming/api/operators/collect/CollectSinkFunctionTest.java:
##########
@@ -54,6 +55,19 @@ void after() throws Exception {
         functionWrapper.closeWrapper();
     }
 
+    @Test
+    void testCloseBeforeOpenDoesNotThrow() {

Review Comment:
   minor: This covers the never-opened teardown, but not the 
initializeState()-ran-but-open()-didn't case. There, bufferLock is already set 
(via initBuffer()) so the bufferLock == null guard doesn't fire, and 
accumulateFinalResults() runs on into serializeAccumulatorResult(offset, 
version=null, …). It doesn't NPE today only because StringSerializer tolerates 
a null version — nothing here pins that down. Could you add a case that calls 
initializeState(...) without open() and then asserts 
accumulateFinalResults()/close() don't throw? (Would need a small 
"initialize-only" hook on CollectSinkFunctionTestWrapper, since it currently 
only exposes openFunction()/openFunctionWithState().)



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