-
Notifications
You must be signed in to change notification settings - Fork 14.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(jobs/triggerer_job_runner): add triggerer canceled log #31757
feat(jobs/triggerer_job_runner): add triggerer canceled log #31757
Conversation
e7ed504
to
fd96e7d
Compare
92a4772
to
efd4e0c
Compare
69471d7
to
f98d0fe
Compare
f98d0fe
to
9e65ed4
Compare
@dstandish I tried to dig into the code a bit and found out the error message mentioned in #30853 (comment) is from check_trigger_timeouts. Thus, I tried to add a similar timeout check here. I've not yet had time to test it today but would like to see what you think about it. Thanks! |
1679327
to
d5580b6
Compare
…ror when logging triggerer timeout
0fe0cd4
to
c38635b
Compare
…o error when encountering asyncio.CancelledError
airflow/jobs/triggerer_job_runner.py
Outdated
trigger_timeout = trigger.task_instance.trigger_timeout | ||
if trigger_timeout: | ||
if not trigger_timeout.tzinfo: | ||
trigger_timeout = trigger_timeout.replace(tzinfo=timezone.utc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curious why the the tzinfo line is necessary. it seems that it should already be UTC. are you just being defensive or did you encounter an issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I encountered the timezone issue after I change the fallback here to 1.0 for testing.
… operator Co-authored-by: Daniel Standish <[email protected]>
if timeout := trigger.task_instance.trigger_timeout: | ||
timeout = timeout.replace(tzinfo=timezone.utc) if not timeout.tzinfo else timeout | ||
if timeout < timezone.utcnow(): | ||
self.log.error("Trigger cancelled due to timeout") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the timeout case, does it log the error twice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it logs the timeout error and the original asyncio.CancelledError
message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
Emit log message when trigger is cancelled Co-authored-by: Daniel Standish <[email protected]> Co-authored-by: Jed Cunningham <[email protected]> (cherry picked from commit a60429e)
We tried to address apache#31720 in PR apache#31757. The issue talked about adding a trigger cancelled log when trigger timesout, but we also added a generic Trigger canceled log. This log appears even in successful runs of the triggers when they finish. This is confusing some users as the log level is Error and there are sometimes quite a few log lines saying "Trigger cancelled; err=" with giving no clue as to what is happening. So, I am removing this generic error log line and we can add specific cancel scenarios with detailed reasons when we implement those.
We tried to address #31720 in PR #31757. The issue talked about adding a trigger cancelled log when trigger timesout, but we also added a generic Trigger canceled log. This log appears even in successful runs of the triggers when they finish. This is confusing some users as the log level is Error and there are sometimes quite a few log lines saying "Trigger cancelled; err=" with giving no clue as to what is happening. So, I am removing this generic error log line and we can add specific cancel scenarios with detailed reasons when we implement those.
closes: #31720
^ 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.rst
or{issue_number}.significant.rst
, in newsfragments.