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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]