-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TUI Client can handle server crashes #21843
Comments
A potential problem here is that it may be hard to tell a normal server exit using A possible solution is to add a "stop" UI event and make the server send it when exiting normally, so when the server exits without sending a "stop" event it has likely crashed. |
Problem: 1. Some calls to preserve_exit() don't put a message in IObuff, so the IObuff print by preserve_exit() contains unrelated information. 2. If a TUI client runs out of memory or receives a deadly signal, the error message is shown on alternate screen and cannot be easily seen because the TUI exits alternate screen soon afterwards. Solution: Pass error message to preserve_exit() and exit alternate screen before printing it. Note that this doesn't fix the problem that server error messages cannot be easily seen on exit. This is tracked in neovim#21608 and neovim#21843.
Problem: 1. Some calls to preserve_exit() don't put a message in IObuff, so the IObuff printed by preserve_exit() contains unrelated information. 2. If a TUI client runs out of memory or receives a deadly signal, the error message is shown on alternate screen and cannot be easily seen because the TUI exits alternate screen soon afterwards. Solution: Pass error message to preserve_exit() and exit alternate screen before printing it. Note that this doesn't fix the problem that server error messages cannot be easily seen on exit. This is tracked in neovim#21608 and neovim#21843.
Problem: 1. Some calls to preserve_exit() don't put a message in IObuff, so the IObuff printed by preserve_exit() contains unrelated information. 2. If a TUI client runs out of memory or receives a deadly signal, the error message is shown on alternate screen and cannot be easily seen because the TUI exits alternate screen soon afterwards. Solution: Pass error message to preserve_exit() and exit alternate screen before printing it. Note that this doesn't fix the problem that server error messages cannot be easily seen on exit. This is tracked in #21608 and #21843.
Problem: 1. Some calls to preserve_exit() don't put a message in IObuff, so the IObuff printed by preserve_exit() contains unrelated information. 2. If a TUI client runs out of memory or receives a deadly signal, the error message is shown on alternate screen and cannot be easily seen because the TUI exits alternate screen soon afterwards. Solution: Pass error message to preserve_exit() and exit alternate screen before printing it. Note that this doesn't fix the problem that server error messages cannot be easily seen on exit. This is tracked in neovim#21608 and neovim#21843.
#25288 makes it possible to tell |
Problem
One of the main advantages of having separate processes for backend server and TUI client is that a segfault in the server doesn't need to be fatal for the client. The client could display a message what happened, clear the terminal or even try to restart the server.
At the moment, users just observe a crash without information what happened.
Example of a crash nvim-treesitter/nvim-treesitter#4170 . In case of a SEGFAULT, users could get a link to a wiki page that explains how to obtain coredumps or debug the crashing process via gdb.
Expected behavior
I would expect to read an error message on a unexpected termination of the server and including the bad return code and if possible whether the server process was kill by a signal. Users could be informed whether there are any steps to investigate and report the issue or where to find possible logs or stderr of the child process.
OBS for instance uses a separate process for ffmpeg muxing. When it segfaults or crashes in another way you get a error message explaining what happened.
The terminal client might even have enough state information to offer to try to recover the crashed session.
The text was updated successfully, but these errors were encountered: