Make sure stale file handler doesn't crash the DagFileProcessorManager#69324
Conversation
SameerMesiah97
left a comment
There was a problem hiding this comment.
Looks good. Just one nit if you want to address it.
potiuk
left a comment
There was a problem hiding this comment.
Approving — small, correctly-scoped fix for the stale-NFS-handle crash in #69321. Routing all three logger_filehandle.close() sites through a close() that swallows OSError is the right call, and reaching for LoggingMixin's self.log rather than self.process_log (which writes through the very handle that just went stale) is a nice touch.
A couple of non-blocking nits:
- One inline comment on the
terminate_orphan_processestest — it mocks the whole processor, so it doesn't actually exercise theOSErrorswallow (the other two tests do). - The commit subjects use
refactor:Conventional-Commit prefixes, which Airflow disallows (check-no-conventional-commit-message). It's acommit-msg-stage hook so it isn't gating CI, and the squash-merge uses the clean PR title — but worth rewording/squashing to keep history tidy.
Optional follow-up (out of scope here): a stale handle can also raise on writes via structlog.BytesLogger, not just on close — worth keeping in mind if the crash recurs from a different frame.
This review was drafted by an AI-assisted tool and confirmed by an Airflow maintainer. The maintainer approving this PR has read the findings and signed off. If something feels off, please reply on the PR and a maintainer will follow up.
More on how Airflow handles maintainer review: contributing-docs/05_pull_requests.rst.
…more DRY approach on how to close the logger file handler and catch OSError if file handler is stale
054ffc0 to
e4163a4
Compare
|
rebased it as well - fell free to merge with/without nit |
Thanks for the review @potiuk will fix nits before merging. |
…phan_processes_tolerates_stale_file_handle_on_close
As described in issue #69321, this PR makes sure a stale file handler doesn't crash the
DagFileProcessorManager. The OSError should be catched and logged as warning instead.Was generative AI tooling used to co-author this PR?
Claude Opus 4.6
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.