1996fanrui commented on PR #20151:
URL: https://github.com/apache/flink/pull/20151#issuecomment-1285706618

   > With a shared `ChannelStateWriteRequestExecutorImpl` there would be no 
need for the second level of the synchornisation. Making the code more 
efficient (due to fewer synchronisation and also keeping the one writing thread 
per file) and also simpler with fewer opportunities for race 
conditions/deadlocks.
   > 
   > WDYT? Am I missing something?
   
   Hi @pnowojski , thanks for your hard review. 
   
   Currently, there is one `ChannelStateWriterImpl` per subtask and one 
`ChannelStateWriteRequestExecutorImpl` per `ChannelStateWriterImpl`. That is: 
each subtask has one thread to write the channel state file.
   
   As I understand, you mean that multiple `ChannelStateWriterImpl` share the 
same `ChannelStateWriteRequestExecutorImpl`. When 
`channel-state.number-of-tasks-share-file=5`, each thread is responsible for 
writing the channel state file for 5 subtasks, right? Since the file is written 
in a single thread, there is no need to consider thread safety issues. 
   
   Your proposal should be clearer. I will try to refactor the code according 
to your proposal. Thanks again~


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