-
Notifications
You must be signed in to change notification settings - Fork 16.6k
fix(celery): check app context before session removal in teardown #37574
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
base: master
Are you sure you want to change the base?
fix(celery): check app context before session removal in teardown #37574
Conversation
Add has_app_context() check before calling db.session.remove() in the task_postrun signal handler to prevent RuntimeError when the handler fires after the Flask app context has been torn down. Fixes apache#36892
Co-authored-by: codeant-ai-for-open-source[bot] <244253245+codeant-ai-for-open-source[bot]@users.noreply.github.com>
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Code Review Agent Run #8b4eb7Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
SUMMARY
Add
has_app_context()check before callingdb.session.remove()in thetask_postrunsignal handler to preventRuntimeError: Working outside of application contextwhen the handler fires after the Flask app context has been torn down.Fixes #36892
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A - backend fix
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION