Conversation
Different process and Airflow timezones can make a file modified at 12:00 UTC pass a 14:00 UTC threshold, or reject a file that is new enough. Pattern matching should compare absolute modification times regardless of either timezone setting. Related: apache#73382
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
|
mifuha
marked this pull request as ready for review
September 19, 2026 19:09
mifuha
marked this pull request as draft
September 19, 2026 19:52
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
SFTPTriggerusesfile_patternwithnewer_than, different process and Airflow timezones can make it choose the wrong files. A file modified at 12:00 UTC can incorrectly pass a 14:00 UTC threshold. Reversing the timezone settings can reject a file that is new enough.This fix reads the modification timestamp directly as UTC. It keeps the existing inclusive comparison and whole-second precision.
The regression tests run the real trigger in fresh processes with different timezone settings and mocked SFTP calls. They cover both wrong decisions, UTC controls, equal timestamps, a non-hour timezone offset, fractional seconds and missing modification times.
Related: #73382. The single-file trigger and synchronous sensor paths still use the existing string-based hook methods and remain affected. This PR leaves those interfaces unchanged, so the issue should stay open.
Checks run with locked dependencies:
git diff --checkpassed.The manual provider check could not finish because the local environment reported bus and I/O errors while Docker was exporting its CI image. The full provider suite, live SFTP tests and compatibility matrix were not run locally.
— @mifuha
Was generative AI tooling used to co-author this PR?
AI-assisted: following the guidelines. I used Codex to help investigate the issue, write the fix and tests.