You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "SolidWallOfCode (via GitHub)" <gi...@apache.org> on 2023/09/09 03:18:22 UTC

[GitHub] [trafficserver] SolidWallOfCode commented on a diff in pull request #10098: Allow configurable number of accepts per event loop

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: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org