You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
QWP sender close() skips WebSocket CLOSE when the I/O thread is descheduled >100 ms #117
CursorWebSocketSendLoop.close() waits 100 ms (DEFAULT_CLOSE_GRACEFUL_STOP_MILLIS) for the I/O thread to exit, then calls closeTraffic() (:1380). On a CPU-starved host a healthy, idle I/O thread can miss that window, so the socket is shut down before its exit path (:2741) sends the WebSocket CLOSE and TLS close_notify. The server logs detected EOF instead of a clean close. No data loss: drainOnClose() completes first.
Seen once in CI on a 2-vCPU Windows agent; the server log shows a 118 ms scheduling gap right before the EOF and no CLOSE received.
Fix: call closeTraffic() only when the I/O thread is actually blocked in sendBinary/sendPing (volatile flag around those calls); otherwise keep waiting on shutdownLatch up to the existing backstop.
Line refs: 1.3.11, unchanged on main. Window introduced in a7e7db3 (#104).
changed the title [-]QWP sender close() drops the connection without a WebSocket CLOSE when the I/O thread is descheduled for more than 100 ms[/-][+]QWP sender close() skips WebSocket CLOSE when the I/O thread is descheduled >100 ms[/+]on Oct 27, 2026
Activity
[-]QWP sender close() drops the connection without a WebSocket CLOSE when the I/O thread is descheduled for more than 100 ms[/-][+]QWP sender close() skips WebSocket CLOSE when the I/O thread is descheduled >100 ms[/+]