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

Forward exitcode after signals like SIGINT #81

Merged
merged 3 commits into from Apr 2, 2023

Conversation

mrcljx
Copy link
Contributor

@mrcljx mrcljx commented Mar 23, 2023

HTTP servers tend to support graceful shutdown and will return
an exitcode of 0 when sending a signal like SIGINT.

This change will make hupper return that exitcode instead of
always exiting with 1.

Should fix #80 if the IDE does not break on SystemExit(0).

Test Plan

  • Ran hupper --shutdown-interval 5 -m http.server
  • Hit Ctrl+C
  • Observed exitcode of 0

@mrcljx mrcljx changed the title Forward exitcode after signals like SIGINT (fixes #80) Forward exitcode after signals like SIGINT Mar 23, 2023
@mrcljx
Copy link
Contributor Author

mrcljx commented Mar 23, 2023

  • I tried to ensure not to accidentally revert https://github.com/Pylons/hupper/pull/67/files
  • I have not found a good place to add tests for this behavior. Do you have any guidance?
  • CONTRIBUTING mentions updating CHANGES.rst, but there is no "next" section at the top, so I didn't feel good about adding a whole section there.

@mmerickel
Copy link
Member

Hey thanks for this, I'll try to find some time to look at it in the next few days!

src/hupper/reloader.py Outdated Show resolved Hide resolved
src/hupper/reloader.py Outdated Show resolved Hide resolved
@mmerickel mmerickel merged commit 7cd636b into Pylons:main Apr 2, 2023
27 checks passed
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.

Can the exit code be changed?
2 participants