]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/msg/async/AsyncMessenger.cc
update sources to 12.2.10
[ceph.git] / ceph / src / msg / async / AsyncMessenger.cc
index 1913e8f4c6eea8bb1f530a248094a21475e24925..abe0b474170ec42ca4139a9d6c892e27777ab43a 100644 (file)
@@ -165,6 +165,8 @@ void Processor::accept()
   opts.nodelay = msgr->cct->_conf->ms_tcp_nodelay;
   opts.rcbuf_size = msgr->cct->_conf->ms_tcp_rcvbuf;
   opts.priority = msgr->get_socket_priority();
+  unsigned accept_error_num = 0;
+
   while (true) {
     entity_addr_t addr;
     ConnectedSocket cli_socket;
@@ -185,7 +187,11 @@ void Processor::accept()
       } else if (r == -EMFILE || r == -ENFILE) {
         lderr(msgr->cct) << __func__ << " open file descriptions limit reached sd = " << listen_socket.fd()
                          << " errno " << r << " " << cpp_strerror(r) << dendl;
-        break;
+       if (++accept_error_num > msgr->cct->_conf->ms_max_accept_failures) {
+         lderr(msgr->cct) << "Proccessor accept has encountered enough error numbers, just do ceph_abort()." << dendl;
+         ceph_abort();
+       }
+       continue;
       } else if (r == -ECONNABORTED) {
         ldout(msgr->cct, 0) << __func__ << " it was closed because of rst arrived sd = " << listen_socket.fd()
                             << " errno " << r << " " << cpp_strerror(r) << dendl;
@@ -193,7 +199,11 @@ void Processor::accept()
       } else {
         lderr(msgr->cct) << __func__ << " no incoming connection?"
                          << " errno " << r << " " << cpp_strerror(r) << dendl;
-        break;
+       if (++accept_error_num > msgr->cct->_conf->ms_max_accept_failures) {
+          lderr(msgr->cct) << "Proccessor accept has encountered enough error numbers, just do ceph_abort()." << dendl;
+          ceph_abort();
+       }
+       continue;
       }
     }
   }