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

   ## What type of change is this?
   
   Bug fix.
   
   ## What does this PR do?
   
   Fixes a task supervisor hang when an init process such as `dumb-init` reaps 
the task child before the supervisor collects its exit status.
   
   `psutil.Process.wait(timeout=0)` raises `NoSuchProcess` in that situation. 
Previously, the supervisor left both `_exit_code` and `_process_exit_monotonic` 
unset, so the socket cleanup timeout never started and the supervisor could 
remain alive indefinitely while retaining task sockets and memory.
   
   The supervisor now treats the child as exited with the same unknown exit 
code used by the existing already-terminated kill path and starts the cleanup 
timer. Added a regression test for the reaped-child path.
   
   Fixes #70117.
   
   ## Testing
   
   - `uv run --project task-sdk ruff format 
task-sdk/src/airflow/sdk/execution_time/supervisor.py 
task-sdk/tests/task_sdk/execution_time/test_supervisor.py`
   - `uv run --project task-sdk ruff check --fix 
task-sdk/src/airflow/sdk/execution_time/supervisor.py 
task-sdk/tests/task_sdk/execution_time/test_supervisor.py`
   - Focused Linux test: `TestWatchedSubprocess::test_process_already_reaped` — 
passed
   - Linux `test_supervisor.py`: 166 passed, 6 skipped; remaining 
failures/errors were pre-existing mounted-Windows checkout issues 
(path-sensitive log assertions, missing optional provider/shared-package setup)
   
   ## Checklist
   
   - [x] The change includes regression coverage.
   - [x] The commit has a Signed-off-by line.
   - [ ] Full CI verification


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