-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
Add traceback output for task in case when SIGTERM was sent during task execution #44880
base: main
Are you sure you want to change the base?
Conversation
Can you explain why this is useful helpful? I imagine the stack trace is going to be large and mostly not relevent to when a task was SIGTERMd. |
I agree the traceback can be large in some cases, but the idea is to get the code line on which the task was killed. Ideally it will help to troubleshoot issues that we get |
Following Ash's comment - maybe it would be better to utilize a flag/configuration to enable it? |
Yeah. Configuration to enable it would be better. I think the stackrace where the task was killed is not too useful - really - I am not even sure if it will actually show the place where the process is. Signals are always delivered to the main thread (which is one limitation), and I am not even sure if the stacktrace in this case will be showing where the thread was "in" before. Do you have some examples of such stack-traces generated with it that looks like "useful" @VladaZakharova ? |
I think something like this can be useful:
And the output in the logs will look like this:
Which shows what command it was executing when the SIGTERM happened. Also we already have this output if the task failed due to timeout:
Maybe it makes sense to make the output the same short as when we have a timeout error. We still can see in this example that it outputs the place where it failed |
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.
seems useful enough . @ashb do you have any doubts there, I see that it can indeed add value.
This PR adds ability to output traceback when a task instance is killed externally and SIGTERM is sent to a task runner process.
^ 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.