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

transmit: Add SIGINT shutdown hook (re) #168

Closed
wants to merge 6 commits into from
Closed

transmit: Add SIGINT shutdown hook (re) #168

wants to merge 6 commits into from

Conversation

Majored
Copy link

@Majored Majored commented Feb 4, 2022

Hi all (again ;)),

This PR is in relation to #112 and adds:

  • A ZST error type representing a user interrupt error so that we can return a non 0/1 exit code.
  • The actual SIGINT handling and termination with an exit code of 130.
  • Unit tests for terminating an idle transmit (stdin, stdout) and where the transmit is doing actual work.

As was noted in #131 's code comments, there doesn't seem to exist any crate for programmatically sending Ctrl+C events on Windows which I've added a comment about. There's a chance this could be handled via a raw winapi binding but I don't have access to a Windows machine currently to test. I'll look into it in the future if no one else has by then.

@Majored
Copy link
Author

Majored commented Feb 21, 2022

Looking at other actions, the Windows failure doesn't seem to be related to anything here.

As for why sigint_termination_idle() is failing, I'm unsure - I can't reproduce the failure on my end (Mac OSX M1). My only guess is that GitHub actions closes the child's stdin & stdout instantly somehow, thus the child exits with a 0 exit code rather than 130 (user interrupt). If so, I'm going to need to change the approach for that test...

This pull request was closed.
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.

1 participant