rkhachatryan commented on a change in pull request #11534: 
[FLINK-16537][network] Implement ResultPartition state recovery for unaligned 
checkpoint
URL: https://github.com/apache/flink/pull/11534#discussion_r400761641
 
 

 ##########
 File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamTask.java
 ##########
 @@ -434,6 +434,13 @@ protected void beforeInvoke() throws Exception {
                        // so that we avoid race conditions in the case that 
initializeState()
                        // registers a timer, that fires before the open() is 
called.
                        
operatorChain.initializeStateAndOpenOperators(createStreamTaskStateInitializer());
+
+                       ResultPartitionWriter[] writers = 
getEnvironment().getAllWriters();
+                       if (writers != null) {
+                               for (ResultPartitionWriter writer : writers) {
+                                       writer.initializeState();
+                               }
+                       }
 
 Review comment:
   Yes, I fully agree with what you point. In my PR, I'm closing it in 
`Task.releaseResources`. Just wanted to make sure that we can't close it sooner.
   
   In `ChannelStreamReaderImpl`, the underlying streams are closed as soon as 
all the data is read from them, so it shouldn't be an issue.

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

Reply via email to