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

   ## Description
   
   The default Celery worker liveness probe currently builds the Celery node 
name with the OS-level `hostname` executable:
   
   ```sh
   celery inspect ping -d celery@$(hostname)
   ```
   
   Some minimal container images do not include that executable, which makes 
the probe fail before it can check whether the Celery worker is alive.
   
   This keeps the same behavior of targeting the worker container's hostname, 
but reads it with Python's standard `socket.gethostname()` instead:
   
   ```sh
   celery inspect ping -d celery@$(python -c 'import socket; 
print(socket.gethostname())')
   ```
   
   The probe already depends on Python to run Celery, so this avoids adding 
another OS binary requirement. Kubernetes also documents that the container 
hostname is available through the `gethostname` function call: 
https://kubernetes.io/docs/concepts/containers/container-environment/
   
   ## Testing
   
   ```sh
   prek run --files chart/templates/workers/worker-deployment.yaml 
chart/tests/helm_tests/airflow_core/test_worker.py
   ```
   
   ```text
   Passed
   ```
   
   ```sh
   env PYTHONPATH=tests /private/tmp/airflow-chart-test-venv/bin/python -m 
pytest tests/helm_tests/airflow_core/test_worker.py
   ```
   
   ```text
   377 passed in 159.67s
   ```
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes - OpenAI assistant
   
   Generated-by: OpenAI assistant following 
https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions
   


-- 
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