mirror of https://github.com/sbt/sbt.git
A client disconnecting with a terminal control query outstanding could park a server thread forever, wedging prompts and command dispatch for every client (#6841, #6840): - VirtualTerminal.cancelRequests drained only 2 of the 8 pending terminal maps, so waiters on the set-echo, raw-mode, attributes, and size queues were never woken. It now drains all of them, with offer instead of put so the shutdown path itself cannot block on a full queue. - Raw-mode requests were registered in the set-echo map, so their waiters were invisible to any raw-mode-specific handling. - Closing a channel terminal did not wake readers parked on its input stream; close now delivers EOF so a prompt blocked on a dead client's input unwinds. - The failed-load prompt read its answer byte from System.in, which under non-virtual IO is the process's own stdin and never carries client input; it now reads the active terminal's input stream. - ServerSessionImpl.close() could not deliver EOF to the peer while its read thread was parked in a native read (the native close is never delivered), so the server never noticed orderly client disconnects at all. It now shuts down socket input first, which wakes the reader and lets the close through. Regression test: a raw-protocol client that attaches, triggers the failed-load prompt without answering the raw-mode query, and disconnects; the server must shut down cleanly (EOF at the prompt maps to 'q') instead of staying parked forever. Fails on develop with the server still alive and the command loop parked in setRawMode; passes with this change. VirtualTerminalSpec pins the drain across all eight maps and that other channels are untouched. Generated-by: kimi-code/k3 (Oh My Pi) |
||
|---|---|---|
| .. | ||
| src | ||
| NOTICE | ||