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

Use einfo.tb when traceback is str #392

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jonls
Copy link
Contributor

@jonls jonls commented Sep 20, 2024

Goal

Celery sometimes calls the failure_handler with a string for the traceback parameter instead of an actual traceback object. This was reported in #372 (there's a comment on that request from @clr182 which I think has a misunderstanding about what the issue is about). Other users running into the same issue with Celery a long time ago: celery/celery#806 Here's another Celery user with a similar issue more recently, and a similar fix: scoutapp/scout_apm_python#708

Design

Celery should probably be fixed to supply the traceback object in all cases but I haven't had time to dig into that bug. Even if fixed, the old versions of Celery will be used for some time so a workaround in this library seems reasonable.

Changeset

Changed failure_handler to get the traceback object from a different place if the traceback supplied to the function is a string.

Testing

Tested manually. I don't see any existing test cases that are setup to handle the celery integration. Please let me know if I missed these.

@clr182
Copy link

clr182 commented Sep 23, 2024

Hi @jonls

Thanks for reaching out and raising a PR to fix this issue.
We've added this PR to our backlog to be reviewed and will be sure to update you when we have more information.

In the meantime, would you mind adding comments to the newly added code to give some additional context?

@clr182 clr182 added bug Confirmed bug backlog We hope to fix this feature/bug in the future labels Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog We hope to fix this feature/bug in the future bug Confirmed bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Celery exceptions cause error in capture_stacktrace
2 participants