SolidWallOfCode commented on code in PR #10098:
URL: https://github.com/apache/trafficserver/pull/10098#discussion_r1320468741


##########
iocore/net/UnixNetAccept.cc:
##########
@@ -121,12 +123,20 @@ net_accept(NetAccept *na, void *ep, bool blockable)
       vc->mutex = h->mutex;
       t->schedule_imm(vc);
     }
-  } while (loop);
+  } while (count <= additional_accepts);
 
 Ldone:
   if (!blockable) {
     MUTEX_UNTAKE_LOCK(na->action_->mutex, e->ethread);
   }
+
+  // if we stop looping as a result of hitting the accept limit,
+  // resechedule accepting to the end of the thread event queue
+  // for the goal of fairness between accepting and other work
+  Debug("iocore_net_accepts", "exited accept loop - count: %d, limit: %d", 
count, additional_accepts + 1);
+  if (count == additional_accepts + 1) {

Review Comment:
   Use `>=` just to be safe. It's a good habit.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to