Hello,
I have a fairly busy websocket server. I could receive multiple requests on the websocket, before the clients initiates a close(), but there's no guarantee that the client does a close().
My error log is full of lines like this:
2016/07/18 16:43:28 [error] 10044#10044: *24127 lua tcp socket read timed out, client: 1.2.3.4, server: websocket, request: "GET / HTTP/1.1", host: "websocket"
and when I try to reload nginx, the old workers appear to be stuck in shut-down state pending the stale/old websocket connections.
proctitle: nginx: worker process is shutting down
when I strace the process, it's printing out lines to the error log about the socket read timed out.
In my lua code, I initialize the websocket as:
local ws, err = ws:new { timeout = 3000, max_payload_len = 1310700 }
while true do
local data, t, err = ws:recv_frame()
...
end
ws:send_close()
Is there a way to force cleanup of old websocket connections?