Skip to content

fix(worker): bound gevent warm shutdown - #282

Merged
suguanYang merged 2 commits into
mainfrom
fix/wangbinqi/bounded-worker-shutdown
Aug 14, 2026
Merged

fix(worker): bound gevent warm shutdown#282
suguanYang merged 2 commits into
mainfrom
fix/wangbinqi/bounded-worker-shutdown

Conversation

@suguanYang

@suguanYang suguanYang commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a worker-owned bounded warm-shutdown controller for the gevent pool.
  • Keep broker-reconnect cancellation as a no-op while using Celery's saved original gevent termination only for explicit SIGTERM shutdown.
  • Continue canceling later active tasks when retry/result-backend bookkeeping fails.
  • Add process-level contract coverage for active cancellation, early completion, repeated SIGTERM, reconnect isolation, backend failure, and the ECS child-cleanup budget.

Verification

  • Worker bootstrap and shutdown contract suites: 12 passed.
  • Ruff passed.
  • Pyright passed with 0 errors and 0 warnings for the production changes.
  • Git diff check passed.

Scope

This PR is limited to the worker shutdown behavior required by the Fargate interruption gate. It does not deploy, change AWS resources, or address unrelated code-quality work.

Related to #22

Comment thread apps/worker/tests/support/worker_shutdown_process_app.py Fixed
@suguanYang
suguanYang merged commit 46b1181 into main Aug 14, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants