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

Signal being caught #13

Open
Morganamilo opened this issue Nov 9, 2021 · 2 comments
Open

Signal being caught #13

Morganamilo opened this issue Nov 9, 2021 · 2 comments

Comments

@Morganamilo
Copy link

I'm trapping sigterm and then waiting for user input on stdin.

When I pkill the process it does successfully ignore the signal. But when I hit enter to continue .wait() returns None even though I believe that should have been caught as a pending signal.

.wait() does return the signal if i call .wait() with a timeout and pkill while it waits. with a timeout and pkill during the timeout.

Is this intentional?

@tailhook
Copy link
Owner

tailhook commented Nov 9, 2021

No this is not intentional.

  1. What is your platform?
  2. Are you sure that you don't use other library that captures signals (maybe in some dependency)?
  3. Do you use wait with zero timeout? Try something small non-zero. (Although, zero should also work at least on Linux)
  4. Also try iterating (or just trap.next()) and see if you encounter the signal this way.
  5. You your program has threads? Can it accidentally create two Trap's in parallel?

@Morganamilo
Copy link
Author

  1. Linux
  2. Yes
  3. using Instant::now()
  4. Code has been deleted currently so can't test right now
  5. One thread

I ended up moving to signal-hook and that worked. So I no longer have the code with issue around but I guess I could make a minimal reproducible example some time.

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

No branches or pull requests

2 participants