-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Handle exceptions during node execution more elegantly. #9585
Conversation
Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9585 +/- ##
==========================================
- Coverage 88.08% 88.02% -0.07%
==========================================
Files 178 178
Lines 22433 22439 +6
==========================================
- Hits 19761 19751 -10
- Misses 2672 2688 +16
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
core/dbt/task/runnable.py
Outdated
) | ||
else: | ||
msg = f"Exception on worker thread. {thread_exception}" | ||
fire_event(Note(msg=msg)) |
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.
Should we use the GenericExceptionOnRun
event instead here?
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.
I'd vote for this
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.7.latest 1.7.latest
# Navigate to the new working tree
cd .worktrees/backport-1.7.latest
# Create a new branch
git switch --create backport-9585-to-1.7.latest
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 6fd0a947297056e4a92d796111a2be578b774b47
# Push it to GitHub
git push --set-upstream origin backport-9585-to-1.7.latest
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.7.latest Then, create a pull request where the |
* Handle exceptions during node execution more elegantly. * Add changelog entry. * Fix import * Add task documentation. * Change event type for noting thread exceptions.
* Handle exceptions during node execution more elegantly. * Add changelog entry. * Fix import * Add task documentation. * Change event type for noting thread exceptions. Co-authored-by: Peter Webb <[email protected]>
resolves #9583
Problem
Because of a bug in Python's thread pool mechanism, an uncaught exception on dbt's task threads would cause it to hang.
Solution
Eliminate a follow-up exception that caused a top-level exception to escape.
Checklist