Uh oh!
There was an error while loading. Please reload this page.
fix: force DAG last modified time to UTC - #30243
Conversation
Makes sense, except calling |
5cae2f0 to
91d4142Compareblinkseb
commented
Mar 22, 2023
thanks for the feedback! I've updated the PR to use |
uranusjr
commented
Mar 23, 2023
Is it possible to have a test for this? |
91d4142 to
b06e7a5Compareblinkseb
commented
Mar 23, 2023
I've updated the existing test to trigger the issue by forcing the platform timezone to something different than UTC. Running the test reverting the fix fails (as expected) with this error: Let me know if there's a better way to test that. |
b06e7a5 to
9f303c9CompareUh oh!
There was an error while loading. Please reload this page.
9f303c9 to
4c2f5a5CompareUh oh!
There was an error while loading. Please reload this page.
4c2f5a5 to
381f8eaComparepotiuk
commented
Mar 27, 2023
Awesome work, congrats on your first merged pull request! |
Co-authored-by: Sébastien Brochet <sebastien.brochet@nielsen.com> (cherry picked from commit 7a8b3c4)
This fixture was, in theory, able to reproduce the bug fixed in apache#30243, but I was unable to now. So, let's toss it.
This fixture was, in theory, able to reproduce the bug fixed in apache#30243, but I was unable to now. So, let's toss it.
This fixture was, in theory, able to reproduce the bug fixed in #30243, but I was unable to now. So, let's toss it.
This fixture was, in theory, able to reproduce the bug fixed in apache#30243, but I was unable to now. So, let's toss it.
This fixture was, in theory, able to reproduce the bug fixed in apache#30243, but I was unable to now. So, let's toss it.
Hello,
I've found an issue with the handling of the DAG file last modified time which can trigger an infinite parsing loop, when
file_parsing_sort_modeis set tomodified_time(which seems to be the default value).os.path.getmtime()returns a timestamp, which is converted to a datetime usingdatetime.fromtimestamp. According to the documentation:The resulting datetime is then made aware using
timezone.make_awareusing the user configured timezone, which is not guarantee to be the same as the platform's timezone. If that's not the case, we can end up with modified time in the future and trigger an infinite parsing loop.The fix is to use
datetime.utcfromtimestampto convert the timestamp, to force the resulting datetime in UTC, and explicitly specify the UTC timezone tomake_aware.^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in newsfragments.