From 5083742803479a1ef18431f00dc1f8b5f2cd7ab5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Piotr=20Da=C5=82ek?= Date: Sun, 22 May 2016 15:30:49 +0200 Subject: [PATCH] msg/async: implement ECONNREFUSED detection MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This commit adds code that detects ECONNREFUSED and dispatches appropriate event further in Async messenger. Signed-off-by: Piotr Dałek --- src/msg/async/AsyncConnection.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/msg/async/AsyncConnection.cc b/src/msg/async/AsyncConnection.cc index 96142c3b661e5..ae27252660e9d 100644 --- a/src/msg/async/AsyncConnection.cc +++ b/src/msg/async/AsyncConnection.cc @@ -878,6 +878,10 @@ ssize_t AsyncConnection::_process_connection() r = cs.is_connected(); if (r < 0) { ldout(async_msgr->cct, 1) << __func__ << " reconnect failed " << dendl; + if (r == -ECONNREFUSED) { + ldout(async_msgr->cct, 2) << __func__ << " connection refused!" << dendl; + dispatch_queue->queue_refused(this); + } goto fail; } else if (r == 0) { ldout(async_msgr->cct, 10) << __func__ << " nonblock connect inprogress" << dendl; -- 2.39.5