mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-10-21 14:33:55 +00:00
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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user