From: Ilya Dryomov Date: Fri, 6 Dec 2024 13:42:55 +0000 (+0100) Subject: librbd/migration/HttpClient: don't shut down socket in resolve_host() X-Git-Tag: v18.2.5~195^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=718efa26955b852c5f1a9eb784c4c4ec088179bd;p=ceph.git librbd/migration/HttpClient: don't shut down socket in resolve_host() 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 (cherry picked from commit 5699e4b871c66035c2c425bc9de7022fa2474c78) --- diff --git a/src/librbd/migration/HttpClient.cc b/src/librbd/migration/HttpClient.cc index 49266d5875f..8815e23b60c 100644 --- a/src/librbd/migration/HttpClient.cc +++ b/src/librbd/migration/HttpClient.cc @@ -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) {