-
Notifications
You must be signed in to change notification settings - Fork 56
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
feat(serve): Add graceful Ctrl+C handling with exit message #1238
base: canary
Are you sure you want to change the base?
Conversation
@revidious is attempting to deploy a commit to the Gloo Team on Vercel. A member of the Team first needs to authorize it. |
4534bfc
to
2035b8f
Compare
Started a discussion thread in https://discord.com/channels/1119368998161752075/1316923453814734959 - I have some questions about how this plays with pyo3 and different architectures (it sounds like we handle this fine in N-API world?) Thanks for digging into this! |
This implements a custom signal handling mechanism using the ctrlc crate to: 1. Bypass Python's signal handling 2. Provide consistent behavior across platforms 3. Ensure graceful shutdown with proper exit codes While this is a workaround, it provides reliable interrupt handling without requiring major architectural changes to BAML's signal handling.
2035b8f
to
d1952d6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is clever! Nice work with this
We could use a oneshot channel for the signal but I really like this - on the one hand spawning an additional thread feels overkill, but it's also a neat way to avoid wiring in Python::check_signals
everywhere
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Sorry for the delay! I was in a GitHub beta for a new UI and couldn't figure out how to trigger workflows on your PR (maintainers need to explicitly approve PRs from new contributors) |
Hmm - looks like I can't push to your branch to update |
Graceful Ctrl+C Handling
Implements reliable Ctrl+C handling for BAML's Python interface with a clean shutdown message. This fixes issues with signal handling across the Python/Rust boundary and improves user experience when stopping BAML processes.
Changes
ctrlc
crateTesting
Technical Details
ctrlc
crate for reliable cross-platform signal handlingNotes
Important
Enhances BAML's Python interface with reliable Ctrl+C handling and clean shutdown message using the
ctrlc
crate.ctrlc
crate for cross-platform signal handlingThis description was created by for the latest commit. It will automatically update as commits are pushed.