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

   Backport of #69523 to `v3-3-test` for the 3.3.2 release.
   
   Fixes the DagProcessorJob dying with `ValueError: write to closed file` when 
an orphaned processor is force-killed: `supervisor.py` gains 
`cleanup_sockets_after_kill()` (drains + closes the log-bearing sockets after a 
kill) and `_log_to_target()` (swallows the "closed file" error). The 
processor's `close()` calls the new cleanup.
   
   **Backport adaptation (this fix sits on un-backported DAG-processor 
refactors not on `v3-3-test`):**
   - `supervisor.py` changes applied clean.
   - `DagFileProcessorProcess` on `v3-3-test` did not inherit `LoggingMixin` 
(main does) — added it, which provides the `self.log` used by `close()` and the 
instance `__dict__` the tests need. Also added the `close()` override.
   - `manager.py` on `v3-3-test` called `processor.logger_filehandle.close()` 
directly at 3 sites; main calls `processor.close()` (which now also drains 
sockets). Rewired all 3 to `processor.close()`, matching main exactly 
(behavior-preserving plus the socket drain).
   
   **Verification:** the 3 new orphan-kill/close tests pass; full 
`test_manager.py` + `test_processor.py` = 219 passed; ruff clean.
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 4.8)
   
   Generated-by: Claude Code (Opus 4.8) following [the 
guidelines](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