weixiuli commented on code in PR #37015:
URL: https://github.com/apache/spark/pull/37015#discussion_r908345107
##########
common/network-common/src/main/java/org/apache/spark/network/server/TransportChannelHandler.java:
##########
@@ -158,10 +158,12 @@ 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) {
+ // Do not modify the order of hasInFlightRequests and
isActuallyOverdue (see SPARK-27073)
+ boolean hasInFlightRequests = responseHandler.hasOutstandingRequests();
boolean isActuallyOverdue =
System.nanoTime() - responseHandler.getTimeOfLastRequestNs() >
requestTimeoutNs;
if (e.state() == IdleState.ALL_IDLE && isActuallyOverdue) {
- if (responseHandler.hasOutstandingRequests()) {
+ if (hasInFlightRequests) {
Review Comment:
Could you explain why "Do not modify the order of hasInFlightRequests and
isActuallyOverdue " please ?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]