From 3001fad4b6d7e692f6070ef166ed4a3e4849760f Mon Sep 17 00:00:00 2001 From: Haomai Wang Date: Fri, 17 Apr 2015 22:07:00 +0800 Subject: [PATCH] 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 (cherry picked from commit 0ea0e011a6a6c6d6b40f5d97328bbad0e4568dd7) --- src/msg/simple/Pipe.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/msg/simple/Pipe.cc b/src/msg/simple/Pipe.cc index 74f2c876218..f5d8a362a29 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; } -- 2.47.3