]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE12-rx-deal-with-missed-keepalives-by-accurately-tracking-call-number-20011229
authorGarry Zacheiss <zacheiss@mit.edu>
Sat, 29 Dec 2001 23:17:48 +0000 (23:17 +0000)
committerDerrick Brashear <shadow@dementia.org>
Sat, 29 Dec 2001 23:17:48 +0000 (23:17 +0000)
(as originally discovered by ted@mit.edu)

"This fix deals with the following lose case:
  Client starts a call that, for some reason, takes a long time on the
  server.  While the client waits for the server to finish, client and
  server usually send each other keep alive packets.  If something
  causes those packets to be delayed or dropped, then the client will
  conclude that the call has failed or finished (usually failed), while
  the server is still *busy* doing the call.

  In this circumstance, the client will initiate another call and the
  server will correctly respond that it is busy.  Unfortunately, if the
  callNumber of a received packet doesn't match the callNumber of the
  outstanding call, then the client never sees that the server says it's
  busy.  Instead the server appears as a black hole to the client.

  This fix ensures that the client sees the busy packets when its
  callNumber is reasonably out of sync with the server."

src/rx/rx_packet.c

index 8b7051eca7d77127e58de865c3d61135a9bbbfd4..c2ecbc578a604f85dcc86d702677af2990ecb2df 100644 (file)
@@ -1772,10 +1772,6 @@ rxi_SendSpecial(call, conn, optionalPacket, type, data, nbytes, istack)
     if (call) {
        channel = call->channel;
        callNumber = *call->callNumber;
-       /* BUSY packets refer to the next call on this connection */
-       if (type == RX_PACKET_TYPE_BUSY) {
-           callNumber++;
-       }
     } else {
        channel = 0;
        callNumber = 0;
@@ -1784,6 +1780,12 @@ rxi_SendSpecial(call, conn, optionalPacket, type, data, nbytes, istack)
     if (!p) {
        p = rxi_AllocPacket(RX_PACKET_CLASS_SPECIAL);
        if (!p) osi_Panic("rxi_SendSpecial failure");
+    } else if (type == RX_PACKET_TYPE_BUSY) {
+       /* BUSY packets refer to some subsequent call on this connection
+        * and we need to match the callNumber used by the other side. */
+       if (p->header.callNumber > callNumber) {
+           callNumber = p->header.callNumber;
+       }
     }
 
     if (nbytes != -1)