rx: Remove RX_CALL_IDLE
authorAndrew Deason <adeason@sinenomine.net>
Thu, 30 Jan 2014 06:39:39 +0000 (00:39 -0600)
committerJeffrey Altman <jaltman@your-file-system.com>
Wed, 11 Feb 2015 14:05:20 +0000 (09:05 -0500)
After change Ie0497d24f1bf4ad7d30ab59061f96c3298f47d17, RX_CALL_IDLE
is not generated by Rx anymore; "idle dead" timeouts just cause
RX_CALL_TIMEOUT errors. Any code dealing with it is thus now dead code
(this value was deliberately never sent over the wire), so remove the
dead code.

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

src/WINNT/afsd/cm_conn.c
src/WINNT/afsd/cm_utils.c
src/afs/afs_analyze.c
src/afs/afs_conn.c
src/rx/rx.c
src/rx/rx.h

index 341a9dd..b888622 100644 (file)
@@ -1022,85 +1022,6 @@ cm_Analyze(cm_conn_t *connp,
 
        retry = 2;
     }
-    else if (errorCode == RX_CALL_IDLE) {
-        /*
-         * RPC failed because the server failed to respond with data
-         * within the idle dead timeout period.  This could be for a variety
-         * of reasons:
-         *  1. The server could have a bad partition such as a failed
-         *     disk or iSCSI target and all I/O to that partition is
-         *     blocking on the server and will never complete.
-         *
-         *  2. The server vnode may be locked by another client request
-         *     that is taking a very long time.
-         *
-         *  3. The server may have a very long queue of requests
-         *     pending and is unable to process this request.
-         *
-         *  4. The server could be malicious and is performing a denial
-         *     of service attack against the client.
-         *
-         * If this is a request against a .readonly with alternate sites
-         * the server should be marked down for this request and the
-         * client should fail over to another server.  If this is a
-         * request against a single source, the client may retry once.
-         */
-       if (connp)
-           _InterlockedAnd(&connp->flags, ~CM_CONN_FLAG_NEW);
-
-        if (serverp)
-            sprintf(addr, "%d.%d.%d.%d",
-                    ((serverp->addr.sin_addr.s_addr & 0xff)),
-                    ((serverp->addr.sin_addr.s_addr & 0xff00)>> 8),
-                    ((serverp->addr.sin_addr.s_addr & 0xff0000)>> 16),
-                    ((serverp->addr.sin_addr.s_addr & 0xff000000)>> 24));
-
-        if (fidp) {
-            code = cm_FindVolumeByID(cellp, fidp->volume, userp, reqp,
-                                     CM_GETVOL_FLAG_NO_LRU_UPDATE,
-                                     &volp);
-            if (code == 0) {
-                statep = cm_VolumeStateByID(volp, fidp->volume);
-
-                if (statep)
-                    replicated = (statep->flags & CM_VOL_STATE_FLAG_REPLICATED);
-
-                lock_ObtainRead(&cm_volumeLock);
-                cm_PutVolume(volp);
-                lock_ReleaseRead(&cm_volumeLock);
-                volp = NULL;
-            }
-
-            if (storeOp)
-                scp = cm_FindSCache(fidp);
-           if (scp) {
-                if (cm_HaveCallback(scp)) {
-                    lock_ObtainWrite(&scp->rw);
-                    cm_DiscardSCache(scp);
-                    lock_ReleaseWrite(&scp->rw);
-
-                    /*
-                     * We really should notify the redirector that we discarded
-                     * the status information but doing so in this case is not
-                     * safe as it can result in a deadlock with extent release
-                     * processing.
-                     */
-                }
-                cm_ReleaseSCache(scp);
-            }
-        }
-
-        if (replicated && serverp) {
-            reqp->errorServp = serverp;
-            reqp->tokenError = errorCode;
-
-           retry = 2;
-        }
-
-        LogEvent(EVENTLOG_WARNING_TYPE, MSG_RX_IDLE_DEAD_TIMEOUT, addr, retry);
-        osi_Log2(afsd_logp, "cm_Analyze: RPC failed due to idle dead timeout addr[%s] retry=%u",
-                 osi_LogSaveString(afsd_logp,addr), retry);
-    }
     else if (errorCode == RX_CALL_DEAD) {
         /* mark server as down */
         if (serverp)
@@ -1610,7 +1531,8 @@ static void cm_NewRXConnection(cm_conn_t *tcp, cm_ucell_t *ucellp,
         rx_SetConnHardDeadTime(tcp->rxconnp, HardDeadtimeout);
 
     /*
-     * Setting idle dead timeout to a non-zero value activates RX_CALL_IDLE errors
+     * Setting idle dead timeout to a non-zero value activates RX_CALL_TIMEOUT
+     * errors if the call is idle for a certain amount of time.
      */
     if (replicated) {
        _InterlockedOr(&tcp->flags, CM_CONN_FLAG_REPLICATION);
index 6c7718e..ea19f7b 100644 (file)
@@ -217,8 +217,6 @@ long cm_MapRPCError(long error, cm_req_t *reqp)
         error == RX_MSGSIZE ||
         error == VNOSERVICE)
        error = CM_ERROR_TIMEDOUT;
-    else if (error == RX_CALL_IDLE)
-        error = EIO;
     else if (error == RX_INVALID_OPERATION)
         error = CM_ERROR_INVAL_NET_RESP;
     else if (error < 0)
@@ -284,7 +282,6 @@ long cm_MapRPCErrorRmdir(long error, cm_req_t *reqp)
     if (error == RX_CALL_DEAD ||
         error == RX_CALL_TIMEOUT ||
         error == RX_CALL_BUSY ||
-        error == RX_CALL_IDLE ||
         error == RX_MSGSIZE ||
         error == VNOSERVICE)
        error = CM_ERROR_TIMEDOUT;
@@ -338,7 +335,6 @@ long cm_MapVLRPCError(long error, cm_req_t *reqp)
     if (error == RX_CALL_DEAD ||
         error == RX_CALL_TIMEOUT ||
         error == RX_CALL_BUSY ||
-        error == RX_CALL_IDLE ||
         error == RX_MSGSIZE ||
         error == VNOSERVICE)
        error = CM_ERROR_TIMEDOUT;
index e34edcd..014bd3e 100644 (file)
@@ -625,7 +625,7 @@ afs_Analyze(struct afs_conn *aconn, struct rx_connection *rxconn,
        shouldRetry = 1;
        goto out;
     }
-    if (acode == RX_CALL_TIMEOUT || acode == RX_CALL_IDLE || acode == VNOSERVICE) {
+    if (acode == RX_CALL_TIMEOUT || acode == VNOSERVICE) {
        serversleft = afs_BlackListOnce(areq, afid, tsp);
        if (afid)
            tvp = afs_FindVolume(afid, READ_LOCK);
index 8cd8a75..be6ab2b 100644 (file)
@@ -513,7 +513,8 @@ afs_ConnBySA(struct srvAddr *sap, unsigned short aport, afs_int32 acell,
            rx_SetConnHardDeadTime(tc->id, afs_rx_harddead);
        }
 
-        /* Setting idle dead time to non-zero activates RX_CALL_IDLE errors. */
+        /* Setting idle dead time to non-zero activates idle-dead
+        * RX_CALL_TIMEOUT errors. */
        if (isrep)
            rx_SetConnIdleDeadTime(tc->id, afs_rx_idledead_rep);
        else
index 63859eb..13a3892 100644 (file)
@@ -5157,7 +5157,6 @@ rxi_SendCallAbort(struct rx_call *call, struct rx_packet *packet,
        return packet;
 
     switch (call->error) {
-    case RX_CALL_IDLE:
     case RX_CALL_BUSY:
         cerror = RX_CALL_TIMEOUT;
         break;
index dbfb66d..f4ad3dc 100644 (file)
@@ -489,11 +489,8 @@ struct rx_ackPacket {
 /* EMSGSIZE returned from network.  Packet too big, must fragment */
 #define RX_MSGSIZE                 (-8)
 
-/*
- * Idle dead timeout error.  This error is never sent on the wire.
- * rxi_SendCallAbort() translates RX_CALL_IDLE to RX_CALL_TIMEOUT.
- */
-#define RX_CALL_IDLE                (-9)
+/* The value -9 was previously used for RX_CALL_IDLE but is now free for
+ * reuse. */
 
 /*
  * Busy call channel error.  This error is never sent on the wire.