]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd/migration/HttpClient: don't shut down socket in resolve_host()
authorIlya Dryomov <idryomov@gmail.com>
Fri, 6 Dec 2024 13:42:55 +0000 (14:42 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 16 Dec 2024 08:51:15 +0000 (09:51 +0100)
resolve_host() is called from init() and issue() when transitioning out
of STATE_UNINITIALIZED and from advance_state() right after the call to
shutdown_socket().  In all three cases the socket should get closed, so
drop the redundant call and place asserts in connect() implementations
instead.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 5699e4b871c66035c2c425bc9de7022fa2474c78)

src/librbd/migration/HttpClient.cc

index 463962befbaa9dfec7524059b629b49cb69172e0..dbe7a16416c64a957a6a1dabd5d26be012a8d1f9 100644 (file)
@@ -229,7 +229,6 @@ private:
     auto cct = m_http_client->m_cct;
     ldout(cct, 15) << dendl;
 
-    shutdown_socket();
     m_resolver.async_resolve(
       m_http_client->m_url_spec.host, m_http_client->m_url_spec.port,
       [this, on_finish](boost::system::error_code ec, auto results) {
@@ -601,6 +600,7 @@ protected:
     auto cct = http_client->m_cct;
     ldout(cct, 15) << dendl;
 
+    ceph_assert(!m_stream.socket().is_open());
     m_stream.async_connect(
       results,
       [on_finish](boost::system::error_code ec, const auto& endpoint) {
@@ -645,6 +645,7 @@ protected:
     auto cct = http_client->m_cct;
     ldout(cct, 15) << dendl;
 
+    ceph_assert(!boost::beast::get_lowest_layer(m_stream).socket().is_open());
     boost::beast::get_lowest_layer(m_stream).async_connect(
       results,
       [this, on_finish](boost::system::error_code ec, const auto& endpoint) {