]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/async: must destruct ConnectedSocket in the his own thread 13680/head
authorHaomai Wang <haomai@xsky.com>
Wed, 1 Mar 2017 12:47:44 +0000 (20:47 +0800)
committerHaomai Wang <haomai@xsky.com>
Wed, 1 Mar 2017 16:05:06 +0000 (00:05 +0800)
Signed-off-by: Haomai Wang <haomai@xsky.com>
src/msg/async/AsyncConnection.cc

index 0dc74d35d135a4520eecc56b5b5d4a4f37e72047..082942cc4448c09f5bc55182f9ddebeea2a7a91b 100644 (file)
@@ -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();