deepujain opened a new pull request, #64305:
URL: https://github.com/apache/airflow/pull/64305

   
   
   ## Summary
   The Celery worker health check only verified that a worker responded to 
`ping`, which let a broker-restarted worker look healthy even after it lost all 
queue subscriptions. This change adds a dedicated health-check command that 
also verifies the worker still reports active queues, so the Docker Compose 
worker probe now fails in the catatonic state described in the issue.
   
   ## Changes
   - **`providers/celery/src/airflow/providers/celery/cli/celery_command.py`** 
-- added a `health_check` CLI command that checks both worker ping and active 
queues.
   - **`providers/celery/src/airflow/providers/celery/cli/definition.py`** -- 
registered the new `celery health-check` subcommand.
   - **`providers/celery/tests/unit/celery/cli/test_celery_command.py`** -- 
added unit tests for the healthy case and both failure modes.
   - **`providers/celery/tests/unit/celery/cli/test_definition.py`** -- updated 
CLI coverage for the new subcommand and its arguments.
   - **`airflow-core/docs/howto/docker-compose/docker-compose.yaml`** -- 
switched the worker healthcheck to the new CLI command.
   - 
**`airflow-core/docs/administration-and-deployment/logging-monitoring/check-health.rst`**
 -- updated the docs to describe the stronger worker health check.
   
   ## Test plan
   - [x] `ruff check 
providers/celery/src/airflow/providers/celery/cli/celery_command.py 
providers/celery/src/airflow/providers/celery/cli/definition.py 
providers/celery/tests/unit/celery/cli/test_celery_command.py 
providers/celery/tests/unit/celery/cli/test_definition.py`
   - [x] `ruff format --check 
providers/celery/src/airflow/providers/celery/cli/celery_command.py 
providers/celery/src/airflow/providers/celery/cli/definition.py 
providers/celery/tests/unit/celery/cli/test_celery_command.py 
providers/celery/tests/unit/celery/cli/test_definition.py`
   - [x] `uv run --project providers/celery pytest 
providers/celery/tests/unit/celery/cli/test_definition.py 
providers/celery/tests/unit/celery/cli/test_celery_command.py -xvs`
   - [x] `prek run --stage pre-commit --files 
airflow-core/docs/howto/docker-compose/docker-compose.yaml 
airflow-core/docs/administration-and-deployment/logging-monitoring/check-health.rst`
   
   Fixes #63580
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to