summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-06-23 18:09:55 -0700
committerSage Weil <sage@inktank.com>2013-06-23 18:09:55 -0700
commit57dc73627eaea0d8f928fd46251accb02e6d8b02 (patch)
treef1178a3d903bff5aa2e8b84df25064e52acdebf4
parent9586305a2317c7d6bbf31c9cf5b67dc93ccab50d (diff)
downloadceph-57dc73627eaea0d8f928fd46251accb02e6d8b02.tar.gz
msgr: clear_pipe+queue reset when replacing lossy connections
We already handle the lossless replacement and lossy fault paths, but not the lossy replacement. This fixes an assert(!cleared) in the reaper. Adjust comments appropriately. Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r--src/msg/Pipe.cc9
-rw-r--r--src/msg/SimpleMessenger.cc4
2 files changed, 10 insertions, 3 deletions
diff --git a/src/msg/Pipe.cc b/src/msg/Pipe.cc
index e425bc1bb2d..b581e367332 100644
--- a/src/msg/Pipe.cc
+++ b/src/msg/Pipe.cc
@@ -555,7 +555,12 @@ int Pipe::accept()
existing->unregister_pipe();
replaced = true;
- if (!existing->policy.lossy) {
+ if (existing->policy.lossy) {
+ // disconnect from the Connection
+ assert(existing->connection_state);
+ if (existing->connection_state->clear_pipe(existing))
+ msgr->dispatch_queue.queue_reset(existing->connection_state.get());
+ } else {
// queue a reset on the old connection
msgr->dispatch_queue.queue_reset(connection_state.get());
@@ -565,7 +570,7 @@ int Pipe::accept()
connection_state = existing->connection_state;
// make existing Connection reference us
- existing->connection_state->reset_pipe(this);
+ connection_state->reset_pipe(this);
// flush/queue any existing delayed messages
if (existing->delay_thread)
diff --git a/src/msg/SimpleMessenger.cc b/src/msg/SimpleMessenger.cc
index 0b0fa662eba..48e37d87098 100644
--- a/src/msg/SimpleMessenger.cc
+++ b/src/msg/SimpleMessenger.cc
@@ -223,7 +223,9 @@ void SimpleMessenger::reaper()
p->pipe_lock.Lock();
p->discard_out_queue();
if (p->connection_state) {
- // mark_down, mark_down_all, or fault() should have done this, but make sure!
+ // mark_down, mark_down_all, or fault() should have done this,
+ // or accept() may have switch the Connection to a different
+ // Pipe... but make sure!
bool cleared = p->connection_state->clear_pipe(p);
assert(!cleared);
}