AngersZhuuuu commented on pull request #30139: URL: https://github.com/apache/spark/pull/30139#issuecomment-717016273
> Hmmm. Every update to `chunkSent` and `chunkBeingSent` will compete for the lock on object `totalChunksBeingTransferred` if we add the `synchronize(totalChunksBeingTransferred)`. This would increase the time for these operations. This would mean that to speed up `chunksBeingTransferred`, we are increasing the time of updates to `streamState`. I know that, but as @jiangxb1987 @mridulm mentioned, we need to ensure the streamState and the totalChunksBeingTransfered are updated synchronically. Add this lock is a strong guarantee. The execution process in the middle of the lock is very fast, so the impact is not really significant ---------------------------------------------------------------- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org