From: Haomai Wang Date: Fri, 17 Apr 2015 14:07:00 +0000 (+0800) Subject: Fix clear_pipe after reaping progress X-Git-Tag: v9.0.1~72^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F4395%2Fhead;p=ceph.git Fix clear_pipe after reaping progress 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 --- diff --git a/src/msg/simple/Pipe.cc b/src/msg/simple/Pipe.cc index 40bf41b90b2d..245eae0165da 100644 --- a/src/msg/simple/Pipe.cc +++ b/src/msg/simple/Pipe.cc @@ -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; }