From f10430015651157fa3dd0f90b5fd37c795e24907 Mon Sep 17 00:00:00 2001 From: Haomai Wang Date: Wed, 1 Mar 2017 20:47:44 +0800 Subject: [PATCH] msg/async: must destruct ConnectedSocket in the his own thread Signed-off-by: Haomai Wang --- src/msg/async/AsyncConnection.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/msg/async/AsyncConnection.cc b/src/msg/async/AsyncConnection.cc index 0dc74d35d135a..082942cc4448c 100644 --- a/src/msg/async/AsyncConnection.cc +++ b/src/msg/async/AsyncConnection.cc @@ -1712,7 +1712,10 @@ ssize_t AsyncConnection::handle_connect_msg(ceph_msg_connect &connect, bufferlis if (existing->delay_state) existing->delay_state->set_center(new_center); } else if (existing->state == STATE_CLOSED) { - cs.close(); + auto back_to_close = std::bind( + [](ConnectedSocket &cs) mutable { cs.close(); }, std::move(cs)); + new_center->submit_to( + new_center->get_id(), std::move(back_to_close), true); return ; } else { ceph_abort(); -- 2.39.5