Copilot commented on code in PR #13898:
URL: https://github.com/apache/trafficserver/pull/13898#discussion_r4459786557
##########
src/iocore/net/UnixNetAccept.cc:
##########
@@ -215,14 +317,28 @@ getNetAccept(int ID)
// Initialize the NetAccept for execution in its own thread.
// This should be done for low latency, high connection rate sockets.
//
-void
+bool
NetAccept::init_accept_loop()
{
int i, n;
char thr_name[MAX_THREAD_NAME_LENGTH];
size_t stacksize;
if (do_blocking_listen()) {
- return;
+ return false;
+ }
+
+ // A thread parked inside accept() cannot see refuse engage, so the next
connection after it did would be accepted
+ // and served. Waiting in poll() instead keeps the decision in front of
every accept4, as on the event thread
+ // paths; the socket is made non-blocking so a sibling that wins the
connection leaves this one with EAGAIN rather
+ // than parked.
+ if (!opt.f_watchdog_exempt &&
RecGetRecordInt("proxy.config.exec_thread.watchdog.timeout_shrink_ms").value_or(0)
> 0) {
Review Comment:
With dedicated accept threads, excluding the loopback companion here leaves
it blocked in `accept4()` while idle. On Linux, closing its descriptor from
`stop_accept()` does not interrupt that call, so the listener can remain open
and accept another connection during the SIGTERM drain instead of letting the
thread reach `release_dedicated()`. Enable the nonblocking/poll path for exempt
listeners too; exemption should bypass backpressure, not shutdown detection.
--
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]