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

[BUG][CODE] remove the panic hook / ensure that it shuts down / restarts the process #757

Open
raggi opened this issue Apr 14, 2024 · 0 comments
Labels
bug Something isn't working wm

Comments

@raggi
Copy link
Collaborator

raggi commented Apr 14, 2024

The panic hook is nice in that it might allow for a log entry on panic. The problem is that the reliability of this is unpredictable, because panic hooks in general are hard to make safe/sound.

It's very unsafe/unsound in almost all cases for the process to keep going after a panic, as it's possible that a panic happening can allow objects to be in a state that violates safety rules, at which point we're working from some kind of corrupt state.

In the somewhat more common case, panics will abort threads, as an example I just caught such a case which terminates the command processing thread:

2024-04-14T04:20:00.276914Z ERROR process_command{ToggleMonocle}:toggle_monocle:monocle_off: komorebi: panicked at komorebi\src\workspace.rs:998:26:
attempt to subtract with overflow panic.file="komorebi\\src\\workspace.rs" panic.line=998 panic.column=26

We should ensure that the process exits after a panic happens. We could choose to restart the process in some way, or not to, but continuing is likely to perpetuate some really tricky to track down issues.

@raggi raggi added bug Something isn't working wm labels Apr 14, 2024
raggi added a commit that referenced this issue Apr 14, 2024
This fixes the panic, but not the underlying problem.

Updates #757
Updates #758
raggi added a commit that referenced this issue Apr 14, 2024
This fixes the panic, but not the underlying problem.

Updates #757
Updates #758
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wm
Projects
None yet
Development

No branches or pull requests

1 participant