Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/5584#discussion_r28662027
--- Diff:
network/common/src/main/java/org/apache/spark/network/server/TransportChannelHandler.java
---
@@ -93,4 +103,25 @@ public void channelRead0(ChannelHandlerContext ctx,
Message request) {
responseHandler.handle((ResponseMessage) request);
}
}
+
+ /** Triggered based on events from an {@link
io.netty.handler.timeout.IdleStateHandler}. */
+ @Override
+ public void userEventTriggered(ChannelHandlerContext ctx, Object evt)
throws Exception {
+ if (evt instanceof IdleStateEvent) {
+ IdleStateEvent e = (IdleStateEvent) evt;
+ // See class comment for timeout semantics. In addition to ensuring
we only timeout while
+ // there are outstanding requests, we also do a secondary
consistency check to ensure
+ // there's no race between the idle timeout and incrementing the
numOutstandingRequests.
+ boolean hasInFlightRequests =
responseHandler.numOutstandingRequests() > 0;
+ boolean isActuallyOverdue =
+ System.nanoTime() - responseHandler.getTimeOfLastRequestNs() >
requestTimeoutNs;
+ if (e.state() == IdleState.ALL_IDLE && hasInFlightRequests &&
isActuallyOverdue) {
+ String address = NettyUtils.getRemoteAddress(ctx.channel());
+ logger.error("Channel to {} has been quiet for {} ms while there
are outstanding " +
--- End diff --
Channel -> Connection?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]