]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Fix clear_pipe after reaping progress 4506/head
authorHaomai Wang <haomaiwang@gmail.com>
Fri, 17 Apr 2015 14:07:00 +0000 (22:07 +0800)
committerLoic Dachary <ldachary@redhat.com>
Wed, 29 Apr 2015 19:14:25 +0000 (21:14 +0200)
In pipe.cc:1353 we stop this connection and we will let reader and write threads stop. If now reader and writer quit ASAP and we call queue_reap to trigger the reap progress. Now we haven't call "connection_state->clear_pipe(this)" in pipe.cc:1379, so we may assert failure  here.

Fixes: #11381
Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
(cherry picked from commit 0ea0e011a6a6c6d6b40f5d97328bbad0e4568dd7)

src/msg/simple/Pipe.cc

index 74f2c8762184bf20dc960ede107574bda402792c..f5d8a362a2983fb2df0300aa9f51869baa75b888 100644 (file)
@@ -1350,7 +1350,11 @@ void Pipe::fault(bool onread)
   if (policy.lossy && state != STATE_CONNECTING) {
     ldout(msgr->cct,10) << "fault on lossy channel, failing" << dendl;
 
+    // disconnect from Connection, and mark it failed.  future messages
+    // will be dropped.
+    assert(connection_state);
     stop();
+    bool cleared = connection_state->clear_pipe(this);
 
     // crib locks, blech.  note that Pipe is now STATE_CLOSED and the
     // rank_pipe entry is ignored by others.
@@ -1372,11 +1376,7 @@ void Pipe::fault(bool onread)
       delay_thread->discard();
     in_q->discard_queue(conn_id);
     discard_out_queue();
-
-    // disconnect from Connection, and mark it failed.  future messages
-    // will be dropped.
-    assert(connection_state);
-    if (connection_state->clear_pipe(this))
+    if (cleared)
       msgr->dispatch_queue.queue_reset(connection_state.get());
     return;
   }