- Use signal.Signals(signum).name consistently in both api_server.py files
- Add fallback for unknown signals with Signal(n) format
- This ensures accurate signal name reporting in logs
Co-authored-by: Jiang-Jia-Jun <163579578+Jiang-Jia-Jun@users.noreply.github.com>
- Translate Chinese comments to English for consistency
- Add subprocess import to api_server.py for TimeoutExpired handling
- Improve signal name detection in worker_process.py using signal.Signals
- Add better docstring comments for signal handlers and cleanup functions
Co-authored-by: Jiang-Jia-Jun <163579578+Jiang-Jia-Jun@users.noreply.github.com>
- Added SIGINT/SIGTERM signal handlers in api_server.py (both OpenAI and simple versions)
- Added cleanup_processes() function to properly terminate worker processes
- Enhanced StandaloneApplication with worker exit hooks and cleanup
- Added signal handling in worker_process.py for graceful worker shutdown
- Added shutdown_event to coordinate graceful shutdown across threads
- Improved worker monitor to respect shutdown event
Co-authored-by: Jiang-Jia-Jun <163579578+Jiang-Jia-Jun@users.noreply.github.com>