You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/03/09 07:00:02 UTC

[GitHub] [spark] liupc commented on a change in pull request #23989: [SPARK-27073][CORE]Handling of IdleStateEvent causes the normal connection to close

liupc commented on a change in pull request #23989: [SPARK-27073][CORE]Handling of IdleStateEvent causes the normal connection to close
URL: https://github.com/apache/spark/pull/23989#discussion_r263989403
 
 

 ##########
 File path: common/network-common/src/main/java/org/apache/spark/network/server/TransportChannelHandler.java
 ##########
 @@ -155,10 +155,11 @@ public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exc
       // To avoid a race between TransportClientFactory.createClient() and this code which could
       // result in an inactive client being returned, this needs to run in a synchronized block.
       synchronized (this) {
+        boolean hasInFlightRequests = responseHandler.numOutstandingRequests() > 0;
 
 Review comment:
   I think we should handle the synchronization when reading/writing with `responseHandler` to fix it. 
   It seems that the `outstandingRequests` related variables of `responeHandler` is not guaranteed to be visible immediately once updated, and the update of `outstandingRequests` and `timeOfLastRequestNs` is not atomic, so that there are cases the fix here not working?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org