-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
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.
Backport failed to create: v2-10-test. View the failure log Run details
You can attempt to backport this manually by running: cherry_picker 9186fc5 v2-10-test This should apply the commit to the v2-10-test branch and leave the commit in conflict state marking After you have resolved the conflicts, you can continue the backport process by running: cherry_picker --continue |
Co-authored-by: Ulada Zakharava <[email protected]> (cherry picked from commit 9186fc5)
Co-authored-by: Ulada Zakharava <[email protected]> (cherry picked from commit 9186fc5) Co-authored-by: VladaZakharova <[email protected]>
Co-authored-by: Ulada Zakharava <[email protected]>
Co-authored-by: Ulada Zakharava <[email protected]>
Co-authored-by: Ulada Zakharava <[email protected]>
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.