Raise the test origin's listen backlog

socketserver listens with a backlog of 5. With concurrent connections
through the proxy on a loaded machine (parallel ctest), the backlog
overflows, the kernel resets the origin connection, and the proxy
correctly drops the client, which surfaced as intermittent
alloc_audit_report failures ("getpeername: Invalid argument" in
ss-local, "Connection reset by peer" in ss-server). Reproduced
reliably at 64 concurrent connections; gone with a backlog of 256.
This commit is contained in:
Max Lv
2026-10-14 22:51:16 +08:00
parent 68bfae9b57
commit 3ae698f5be
+4
View File
@@ -34,6 +34,10 @@ class UDPHandler(socketserver.BaseRequestHandler):
class TCPOrigin(socketserver.ThreadingTCPServer):
daemon_threads = True
# socketserver's default listen backlog is 5. Concurrent connections
# through the proxy overflow it on a loaded machine; the kernel then
# resets the origin connection, which looks like a proxy failure.
request_queue_size = 256
class UDPOrigin(socketserver.ThreadingUDPServer):