]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/Pipe: unregister pipe immediately on fault; fix mark_down
authorSage Weil <sage@inktank.com>
Thu, 19 Jul 2012 21:11:06 +0000 (14:11 -0700)
committerSage Weil <sage@inktank.com>
Sat, 21 Jul 2012 01:36:32 +0000 (18:36 -0700)
This fixes a problem where:

 - pipe faults, con->pipe is cleared
 - ms_handle_reset tries to mark_down, but it doesn't know the pipe

Signed-off-by: Sage Weil <sage@inktank.com>
src/msg/Pipe.cc

index f81f39c7cc8d6353bffd4eee0324fc3b0eb5c56c..ce2ee1684e9cf86366f5cb35258d5bf82b54c5b8 100644 (file)
@@ -990,14 +990,21 @@ void Pipe::fault(bool onconnect, bool onread)
 
     stop();
 
+    // ugh
+    pipe_lock.Unlock();
+    msgr->lock.Lock();
+    pipe_lock.Lock();
+    unregister_pipe();
+    msgr->lock.Unlock();
+
+    in_q->discard_queue();
+    discard_queue();
+
     // disconnect from Connection, and mark it failed.  future messages
     // will be dropped.
     assert(connection_state);
     connection_state->clear_pipe(this);
 
-    in_q->discard_queue();
-    discard_queue();
-
     msgr->dispatch_queue.queue_reset(connection_state);
     return;
   }