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

Handle SIGHUP signals #1310

Closed
wants to merge 1 commit into from
Closed

Handle SIGHUP signals #1310

wants to merge 1 commit into from

Conversation

hrkfdn
Copy link
Owner

@hrkfdn hrkfdn commented Oct 11, 2023

While this probably reintroduces the crashes it should handle SIGHUP again which currently leads into the unreachable!() branch.

Fixes #1309

While this probably reintroduces the crashes it should handle `SIGHUP` again
which currently leads into the `unreachable!()` branch.

Fixes #1309
@ThomasFrans
Copy link
Contributor

This will not fix the issue. I've been looking for the issue and one of the first things I did was to add SIGHUP back to make sure the problem wasn't caused by that. The issue remains. I did some further digging in #1305 and added some findings as comments to that PR. If it's important to fix this for now, the smartest move might be to revert the commit.

Reverting won't fix the actual problem, it will just make it so ncspot panics like it did before the commit, which is better than consuming CPU in the background for sure 😄

@hrkfdn hrkfdn closed this Oct 14, 2023
dricottone added a commit to dricottone/ncspot that referenced this pull request Jan 10, 2024
Commit a067ab2: feat: move to async POSIX signal handler
Instead of trying to handle signals for every step of the `cursive`
event loop, move the signal handling into its own asynchronous task and
send callbacks to `cursive` when a signal arrives.

PR 1305: fix: restore SIGHUP in signal handler
Restore the SIGHUP signal handler which was accidentally removed in a067ab2.

The commit had to be reverted and the PR was closed.

Commit a1a9863: Revert "feat: move to async POSIX signal handler"

ThomasFrans commented: From what I can see, it's an issue introduced by the
crossterm backend. The ncurses one doesn't keep the process running. Currently
I suspect Cursive is doing a write to /dev/tty which is closed, and that write
blocks on the crossterm backend and returns immediately on the ncurses backend.
I guess it could be resolved by switching the default backend (again)?
This would solve hrkfdn#1309 and hrkfdn#1310 and hrkfdn#1282. I'd love to hear thoughts
on this idea. If it's an OK solution, I'd try to see whether I can open an
issue at Cursive or Crossterm to resolve the issue there, and meanwhile switch
backend and add the SIGHUP handler back to finally close all these issues

A commit to deprecate the crossterm/pancurses/termion backends will follow.
@hrkfdn hrkfdn deleted the hf/fix_sig_handlers branch June 30, 2024 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ncspot does not close when terminal is closed
2 participants