Skip to content
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

Truncate traceback for failure email #3086

Merged

Conversation

DoriRunyon
Copy link
Contributor

@DoriRunyon DoriRunyon commented Jun 15, 2021

Description

Add traceback_max_length config option which truncates the traceback included in task failure email (default 5000).

Motivation and Context

Suggesting this change because of an error I encountered: "ClientError: An Error occurred (InvalidParameterValue) when calling the SendRawEmail operation: message length is more than 10485760 bytes long". The root cause was a very long sql query which led to a mysql error. The error traceback included the super long query and due to its length, the luigi "task failure" email failed causing the worker to error during "_handle_next_task". The issue was then disguised, the scheduler continued to show the task as "running". The email that failed was ~17m bytes long. This adds a traceback_max_length config option for the failure email which truncates the traceback included in task failure email (default 5000 which is roughly where Rollbar truncated it).

Have you tested this? If so, how?

I included a unit test

@DoriRunyon DoriRunyon requested review from dlstadther, Tarrasch and a team as code owners June 15, 2021 14:19
Copy link
Collaborator

@dlstadther dlstadther left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we move the traceback_max_length from a constant to a luigi config options? otherwise, i'm good here

@DoriRunyon DoriRunyon force-pushed the truncate-error-email-stack-trace branch 4 times, most recently from bf0d484 to 75501fc Compare June 24, 2021 03:18
@DoriRunyon
Copy link
Contributor Author

Updated @dlstadther-pl. Please let me know if this needs any other changes.

dlstadther
dlstadther previously approved these changes Jun 26, 2021
Copy link
Collaborator

@dlstadther dlstadther left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

idk why some of the Github Action tests fail

luigi/notifications.py Outdated Show resolved Hide resolved
@DoriRunyon DoriRunyon force-pushed the truncate-error-email-stack-trace branch 3 times, most recently from 5a67a80 to b565a58 Compare September 15, 2021 20:48
@DoriRunyon DoriRunyon force-pushed the truncate-error-email-stack-trace branch from b565a58 to ed39ba3 Compare September 15, 2021 20:50
@dlstadther dlstadther merged commit ff7b576 into spotify:master Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants