rx: Do not count RXGEN_OPCODE towards abort threshold 14/12914/2 openafs-stable-1_8_0pre5
authorJeffrey Altman <jaltman@auristor.com>
Sat, 10 Feb 2018 15:47:24 +0000 (10:47 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Mon, 19 Feb 2018 14:40:36 +0000 (09:40 -0500)
An RXGEN_OPCODE is returned for opcodes that are not implemented by the
rx service.  These opcodes might be deprecated opcodes that are no
longer supported or more recently registered opcodes that have yet to
be implemented.  Clients should not be punished for issuing unsupported
calls.  The clients might be old and are issuing no longer supported
calls or they might be newer and are issuing yet to be implemented calls
as part of a feature test and fallback strategy.

This change ignores RXGEN_OPCODE errors when deciding how to adjust the
rx_call.abortCount.  When an RXGEN_OPCODE abort is sent the
rx_call.abortCount and rx_call.abortError are left unchanged which
preserves the state for the next failing call.

Note that this change intentionlly prevents the incrementing of the
abortCount for client connections as they never send delay aborts.

Reviewed-on: https://gerrit.openafs.org/12906
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit f82d1c7d5aeae148305e867c1f79c6ea2f9e0a2a)

Change-Id: I7a4216bea3a355c31a390c5b4753b4ab0c25661c
Reviewed-on: https://gerrit.openafs.org/12914
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

src/rx/rx.c

index 84f6c74..c7742fa 100644 (file)
@@ -5086,7 +5086,14 @@ rxi_SendCallAbort(struct rx_call *call, struct rx_packet *packet,
     if (rx_IsClientConn(call->conn))
        force = 1;
 
-    if (call->abortCode != call->error) {
+    /*
+     * An opcode that has been deprecated or has yet to be implemented is not
+     * a misbehavior of the client.  Do not punish the client by introducing
+     * delays.
+     */
+    if (call->error == RXGEN_OPCODE) {
+       force = 1;
+    } else if (call->abortCode != call->error) {
        call->abortCode = call->error;
        call->abortCount = 0;
     }
@@ -5095,7 +5102,8 @@ rxi_SendCallAbort(struct rx_call *call, struct rx_packet *packet,
        || call->abortCount < rxi_callAbortThreshhold) {
        rxi_CancelDelayedAbortEvent(call);
        error = htonl(call->error);
-       call->abortCount++;
+       if (!force)
+           call->abortCount++;
        packet =
            rxi_SendSpecial(call, call->conn, packet, RX_PACKET_TYPE_ABORT,
                            (char *)&error, sizeof(error), istack);