rx: Set lastBusy on RX_CALL_TIMEOUT
authorAndrew Deason <adeason@sinenomine.net>
Thu, 30 Jan 2014 06:02:24 +0000 (00:02 -0600)
committerJeffrey Altman <jaltman@your-file-system.com>
Wed, 11 Feb 2015 14:06:01 +0000 (09:06 -0500)
Currently, if a server RPC hangs forever, the client call will error
out with RX_CALL_TIMEOUT (if idle/dead timeouts are configured). If we
later try to make a new call on that conn, the server will respond
with BUSY packets, and we'll have to wait until we RX_CALL_TIMEOUT
again. After that we'll set lastBusy and avoid the call channel, but
that extra delay with the BUSY packets is avoidable.

So, avoid this extra delay by setting lastBusy when we kill a call
with RX_CALL_TIMEOUT, so a future rx_NewCall will avoid the call
channel. It makes sense to set lastBusy here, since the call channel
is more likely to be busy than the other call channels.

Change-Id: Iadf77f52ae418491e3108a4b0b5388361f2424aa
Reviewed-on: http://gerrit.openafs.org/10785
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

src/rx/rx.c

index 4bc1d4e..611ca1d 100644 (file)
@@ -2418,6 +2418,11 @@ rx_EndCall(struct rx_call *call, afs_int32 rc)
             * The call channel is definitely not busy if we just successfully
             * completed a call on it. */
            conn->lastBusy[call->channel] = 0;
+
+       } else if (call->error == RX_CALL_TIMEOUT) {
+           /* The call is still probably running on the server side, so try to
+            * avoid this call channel in the future. */
+           conn->lastBusy[call->channel] = clock_Sec();
        }
 
        MUTEX_ENTER(&conn->conn_data_lock);