-
Notifications
You must be signed in to change notification settings - Fork 0
1 feat graceful shutdown #3
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Replace fromJson(env.*) with direct matrix values in CI workflow - Remove unused PYTHON_VERSIONS and OS_MATRIX environment variables - Matrix now correctly uses inline values: python-version: ['3.12', '3.13'], os: ['ubuntu-latest'] - Fixes error: 'env' context is not available in matrix strategy
- Replace env.PRIMARY_PYTHON_VERSION with literal '3.13' in job name - Job-level properties cannot access env context, only step-level can - Fixes error: 'env' context not available in job name property
- Remove complex coverage combining that was failing with 'No data to combine' - Use coverage report from Python 3.13 (primary version) directly - Add condition to only run coverage-report when unit-tests succeed - Simplify artifact download to use specific coverage file - Remove unnecessary uv setup and dependency installation from coverage job Fixes 'No data to combine' error in coverage-report step
- Add cache-dependency-glob: 'uv.lock' to all uv setup actions for consistent cache keys - Remove redundant Python cache from lint job (uv's built-in cache is sufficient) - Remove duplicate Codecov upload from coverage-report job - Standardize caching across all jobs for better performance and consistency Benefits: - Faster CI runs with improved cache hit rates - Consistent caching strategy across all jobs - Reduced workflow complexity and duplication
- Add 'shell: bash' to the coverage test step in unit-tests job - Fixes PowerShell parser error on Windows runners: 'Missing ( after if' - Bash syntax [[ ]] requires bash shell, not PowerShell default on Windows - Ensures cross-platform compatibility for conditional coverage logic
- Add signal handlers for SIGTERM and SIGINT - Implement graceful client disconnection with unbind requests - Add configurable shutdown timeout (default: 30s) - New serve_forever() method for signal-based shutdown - Enhanced context manager with graceful shutdown - Add shutdown_requested property to check shutdown state - Proper error handling during shutdown process Benefits: - Clients receive proper unbind notifications before disconnect - Prevents data loss during server shutdown - Improves overall system reliability and user experience - Follows asyncio best practices for server lifecycle management
- New examples/graceful_server.py demonstrating graceful shutdown - Shows proper signal handling with SIGTERM/SIGINT - Includes event handlers for monitoring client lifecycle - Demonstrates configurable shutdown timeout - Provides clear logging to observe graceful disconnection process Usage instructions and testing guidelines included in docstring.
- Add shutdown_in_progress flag to prevent multiple shutdown attempts - Simplify signal handler to only set event, avoid creating tasks - Improve serve_forever() to properly handle shutdown event - Add better logging for shutdown process - Change example port to 2776 to avoid conflicts Fixes issue where multiple SIGTERM/SIGINT signals caused repeated shutdown attempts
Closed
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.