Skip to content
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

Inconsistent state after some misterious crash. Had to use eglot--managed-mode #115

Closed
tromey opened this issue Sep 14, 2018 · 4 comments
Closed

Comments

@tromey
Copy link
Contributor

tromey commented Sep 14, 2018

I was using eglot with Rust and "something" happened -- I don't know exactly what but I assume that RLS crashed.

After this, eglot ended up in a state where I could do very little. For example, I could not M-x revert-buffer, because some eglot hook function errored (due IIRC the process being dead). I couldn't kill eglot-managed buffers, either. M-x eglot-shutdown did not help.

In the end I skimmed through the eglot source and did M-x eglot--managed-mode.

I think eglot should be more careful about process failures and avoid allowing exceptions to unwind past the boundaries of hook functions.

@joaotavora
Copy link
Owner

I think eglot should be more careful about process failures and avoid allowing exceptions to unwind past the boundaries of hook functions.

I agree to the first part, though I don't fully understand the second. Let's keep this open and mark the eglot--managed-mode a workaround for such situations for now.

@joaotavora joaotavora changed the title had to use eglot--managed-mode Inconsistent state after some misterious crash. Had to use eglot--managed-mode Sep 14, 2018
@joaotavora
Copy link
Owner

By the way, you can try killing RLS or otherwise making it crash on purpose. Eglot should recover automatically, if it doesn't please report here.

@tromey
Copy link
Contributor Author

tromey commented Sep 15, 2018

I don't fully understand the second

For example, in my case I think I found that the eglot function that is attached to kill-buffer-hook was throwing an exception. This was propagating out of the function and so it was terminating the kill-buffer. But I think it would be better not to stop kill-buffer from completing -- so the hook function would have to use condition-case (or ignore-errors, which is simpler) to avoid this.

If I reproduce this again I will be sure to attach more information to this bug.

@joaotavora
Copy link
Owner

(or ignore-errors, which is simpler) to avoid this.

Or with-demoted-errors so, you can debug the thing when it happens (if you happen to have debug-on-error turned on).

bhankas pushed a commit to bhankas/emacs that referenced this issue Sep 18, 2022
…mehow hangs

* eglot.el (eglot--signal-textDocument/didClose): Use
with-demoted-errors.
bhankas pushed a commit to bhankas/emacs that referenced this issue Sep 19, 2022
…mehow hangs

* eglot.el (eglot--signal-textDocument/didClose): Use
with-demoted-errors.
bhankas pushed a commit to bhankas/emacs that referenced this issue Sep 19, 2022
* eglot.el (eglot--signal-textDocument/didClose): Use
with-demoted-errors.

#115: joaotavora/eglot#115
jollaitbot pushed a commit to sailfishos-mirror/emacs that referenced this issue Oct 12, 2022
* eglot.el (eglot--signal-textDocument/didClose): Use
with-demoted-errors.

GitHub-reference: close joaotavora/eglot#115
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants