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
Server exits on shutdown instead of waiting for the exit notification #862
This issue is based on an analysis by Claude and Codex (AI coding agents).
on_shutdown() sets self$exit_flag <- TRUE before sending its response (R/handlers-general.R), and the main loop in run() exits as soon as it sees the flag (R/languageserver.R). So the server terminates right after answering shutdown, without waiting for the exit notification.
The LSP specification says that shutdown asks the server to shut down without exiting, and that the server exits on the subsequent exit notification.
Clients such as vscode-languageclient send exit after the shutdown response arrives. Because the server may already have closed the connection, writing exit can fail (EPIPE on macOS/Linux, ECONNABORTED/ECONNRESET on Windows). In vscode-R, this made stopping a server fail and, on Windows, showed users a "connection to server is erroring" notification. vscode-R is working around it on the client side (REditorSupport/vscode-R#1955).
Suggested fix: in on_shutdown(), do the cleanup and reply, but leave exit_flag unset, so that the server keeps reading until on_exit() sets the flag.
Activity