fix: clean up worker claims during shutdown#1694
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This PR targeted I retargeted it to |
|




Summary
Context
Rally prod canary evidence showed the worker received
/stopand SIGTERM, the worker supervisor stopped quickly, but the process stayed alive until Kubernetes killed it with exit 137. This PR makes termination deterministic and prevents a terminating worker from stranding owned transaction claims when GenVM or active work does not complete inside the pod grace period.Verification
python3 -m py_compile backend/consensus/worker.py backend/consensus/worker_service.py tests/db-sqlalchemy/test_worker_shutdown_claim_cleanup.pypytest tests/db-sqlalchemy/test_worker_shutdown_claim_cleanup.pycould not run locally because this environment is missingalembic(ModuleNotFoundError: No module named 'alembic').