From: Haomai Wang Date: Wed, 1 Mar 2017 12:47:44 +0000 (+0800) Subject: msg/async: must destruct ConnectedSocket in the his own thread X-Git-Tag: v12.0.1~212^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F13680%2Fhead;p=ceph.git msg/async: must destruct ConnectedSocket in the his own thread Signed-off-by: Haomai Wang --- diff --git a/src/msg/async/AsyncConnection.cc b/src/msg/async/AsyncConnection.cc index 0dc74d35d13..082942cc444 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();