]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Added STANDBY state for a connection
authorPatience Warnick <patience@cranium.pelton.net>
Thu, 24 Jan 2008 19:10:09 +0000 (11:10 -0800)
committerPatience Warnick <patience@cranium.pelton.net>
Thu, 24 Jan 2008 19:10:09 +0000 (11:10 -0800)
src/kernel/messenger.c

index 685f7942543c164c41ae720f128d9c54cd5a8158..6c1849b8db993e973d759928080be4c32e634769 100644 (file)
@@ -284,13 +284,20 @@ static void ceph_send_fault(struct ceph_connection *con)
        set_bit(NEW, &con->state);
        clear_bit(CLOSED, &con->state);
        sock_release(con->sock);
-       /* retry with delay */
-       ceph_queue_delayed_write(con);
 
-       if (con->delay < MAX_DELAY_INTERVAL)
-               con->delay *= 2;
-       else
-               con->delay = MAX_DELAY_INTERVAL;
+       /* If there are no messages in the queue, place the connection 
+        * in a STANDBY state otherwise retry with delay */
+       if (list_empty(&con->out_queue)) {
+               set_bit(STANDBY, &con->state);
+       } else {
+               /* retry with delay */
+               ceph_queue_delayed_write(con);
+
+               if (con->delay < MAX_DELAY_INTERVAL)
+                       con->delay *= 2;
+               else
+                       con->delay = MAX_DELAY_INTERVAL;
+       }
 }
 
 
@@ -552,7 +559,6 @@ more:
                /* hmm, nothing to do! No more writes pending? */
                dout(30, "try_write nothing else to write.\n");
                spin_unlock(&con->out_queue_lock);
-               /* TBD PW remove from wait queue if still there.. and put_connection */
                if (con->delay > 1) con->delay = BASE_DELAY_INTERVAL;
                goto done;
        }