This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch 7.0.x
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

commit 85ca5b7c2895cd6115dacbcc8a061fb96cce3bc7
Author: Oknet Xu <xuc...@skyguard.com.cn>
AuthorDate: Tue Sep 20 21:06:14 2016 +0800

    TS-4879: Checking con.fd == NO_FD in NetAccept::do_blocking_accept()
    
    (cherry picked from commit cd3f83af040f9505a3224a41ce7de294899c760e)
---
 iocore/net/UnixNetAccept.cc | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/iocore/net/UnixNetAccept.cc b/iocore/net/UnixNetAccept.cc
index 441275c..c9e1371 100644
--- a/iocore/net/UnixNetAccept.cc
+++ b/iocore/net/UnixNetAccept.cc
@@ -243,6 +243,14 @@ NetAccept::do_blocking_accept(EThread *t)
       continue;
     }
 
+    // The con.fd may exceed the limitation of check_net_throttle() because we 
do blocking accept here.
+    if (check_emergency_throttle(con)) {
+      // The `con' could be closed if there is hyper emergency
+      if (con.fd == NO_FD) {
+        return 0;
+      }
+    }
+
     // Use 'NULL' to Bypass thread allocator
     vc = (UnixNetVConnection *)this->getNetProcessor()->allocate_vc(NULL);
     if (unlikely(!vc || shutdown_event_system == true)) {
@@ -258,8 +266,6 @@ NetAccept::do_blocking_accept(EThread *t)
 
     vc->apply_options();
 
-    check_emergency_throttle(con);
-
     NET_SUM_GLOBAL_DYN_STAT(net_connections_currently_open_stat, 1);
     vc->submit_time = now;
     ats_ip_copy(&vc->server_addr, &vc->con.addr);

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <commits@trafficserver.apache.org>.

Reply via email to