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
slumber process hangs at 100% CPU if parent process is killed #136
If slumber's parent process is killed (with SIGTERM, although not sure it matters how), instead of terminating the slumber process hangs at 100% CPU and stops responding to SIGTERM itself. I've noticed this with both watchexec and zellij as the parent.
I got pretty far on diagnosing this but couldn't figure out a fix. A few things I found out:
Upgrading watchexec to 1.25.1 fixed the issue with watchexec (thanks to this PR)
Zellij sends SIGHUP to its child process on quit, and that signal isn't being handled properly
When the CPU goes to 100%, it's because it's stuck calling crossterm::poll
Despite giving a timeout, it never times out and just blocks on a read syscall
The issue is related to some interaction between crossterm::poll and having signal_hook catch SIGHUP
If you remove SIGHUP from this list, or remove the poll call, the issue disappears and the process exits gracefully
I haven't figured out a way to reproduce this outside of zellij, so it's hard to submit a bug report anywhere for it. I'm not really sure if it's a bug in crossterm or signal_hook (or neither?).
Activity
[-]`slumber` process hangs at 100% CPU[/-][+]`slumber` process hangs at 100% CPU if parent process is killed[/+]LucasPickering commentedon Apr 4, 2024
I got pretty far on diagnosing this but couldn't figure out a fix. A few things I found out:
readsyscallcrossterm::polland havingsignal_hookcatchSIGHUPSIGHUPfrom this list, or remove thepollcall, the issue disappears and the process exits gracefullyI haven't figured out a way to reproduce this outside of zellij, so it's hard to submit a bug report anywhere for it. I'm not really sure if it's a bug in crossterm or signal_hook (or neither?).
Add some logging, set dev logging level to debug
Add some logging, set dev logging level to debug
Refactor main TUI loop to reduce latency in handling messages
Refactor main TUI loop to reduce latency in handling messages
Refactor main TUI loop to reduce latency in handling messages
Refactor main TUI loop to reduce latency in handling messages
Refactor main TUI loop to reduce latency in handling messages
Refactor main TUI loop to reduce latency in handling messages
net/slumber: update to 1.1.0
net/slumber: update to 1.1.0
net/slumber: update to 1.1.0
net/slumber: update to 1.1.0