]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/async: implement ECONNREFUSED detection
authorPiotr Dałek <git@predictor.org.pl>
Sun, 22 May 2016 13:30:49 +0000 (15:30 +0200)
committerPiotr Dałek <git@predictor.org.pl>
Tue, 13 Sep 2016 17:57:05 +0000 (19:57 +0200)
This commit adds code that detects ECONNREFUSED and dispatches appropriate
event further in Async messenger.

Signed-off-by: Piotr Dałek <git@predictor.org.pl>
src/msg/async/AsyncConnection.cc

index 96142c3b661e52ecff7931ef2a556db7cae96285..ae27252660e9d6514548c6bcdc2ee3c49a38530d 100644 (file)
@@ -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;