Minor improvements - #1
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request introduces improvements to process management and signal handling in Carnival, focusing on proper process group termination and enhanced shutdown behavior.
Changes:
- Improved process termination using process groups with
os.killpgto properly terminate child processes - Added configurable graceful shutdown timeout via
stop_timeout_msparameter - Enhanced signal handling to support SIGHUP and track which signal triggered shutdown
- Made init commands interruptible and async with shutdown support
- Added utility function for formatting process exit statuses in logs
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/carnival/process.py | Added process group termination using os.killpg, configurable stop timeout, better exit status logging |
| src/carnival/manager.py | Enhanced signal handling to track signal source, made init commands async and interruptible |
| src/carnival/config.py | Added stop_timeout_ms configuration field and as_command_line() helper method |
| src/carnival/async_utils.py | New utility module for waiting on process or event completion |
| tests/test_process.py | Updated tests to verify process group termination with os.killpg |
| tests/test_manager.py | Updated test assertion for new signal logging message |
| tests/snapshots/test_config.ambr | Updated snapshot to include new stop_timeout_ms field |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 13 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Asked a robot to review the code for possible improvements.