-
Notifications
You must be signed in to change notification settings - Fork 311
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
Bug when calling wf in eager task with thread #3125
Conversation
Signed-off-by: Yee Hing Tong <wild-endeavor@users.noreply.github.com>
Signed-off-by: Yee Hing Tong <wild-endeavor@users.noreply.github.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3125 +/- ##
===========================================
- Coverage 76.83% 46.59% -30.25%
===========================================
Files 204 204
Lines 21665 21622 -43
Branches 2799 2806 +7
===========================================
- Hits 16646 10074 -6572
- Misses 4248 11053 +6805
+ Partials 771 495 -276 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Yee Hing Tong <wild-endeavor@users.noreply.github.com>
Signed-off-by: Yee Hing Tong <wild-endeavor@users.noreply.github.com>
Code Review Agent Run #81ea53Actionable Suggestions - 1
Additional Suggestions - 2
Review Details
|
Changelist by BitoThis pull request implements the following key changes.
|
Code Review Agent Run #507894Actionable Suggestions - 0Review Details
|
Signed-off-by: Yee Hing Tong <wild-endeavor@users.noreply.github.com>
Code Review Agent Run #636e20Actionable Suggestions - 0Review Details
|
Why are the changes needed?
Unable to run subworkflows, as part of eager workflows, via to_thread. This PR only fixes the ability to run subworkflows on the backend. Local execution still needs additional fixes.
What changes were proposed in this pull request?
The issues encountered while debugging this...
My running theory for this is because the context manager is not thread safe. Need to investigate further how to_thread's contextvar copy works. Context copying is needed because we need to accurately represent the state upon entering the thread, but removing the context frames seems to be polluting each other's context.
How was this patch tested?
Tested locally and on Union internal clusters.
Setup process
Screenshots
Check all the applicable boxes
Related PRs
Docs link
Summary by Bito
This PR enhances subworkflow execution in eager workflows via to_thread by implementing improved error handling, state management, and thread safety. Key changes include fixing missing return statements in async calls, improving error messages for worker queue assertions, and enhancing context manager thread safety. The implementation removes unused abort metadata and includes documentation improvements along with comprehensive test additions for workflow execution phases.Unit tests added: True
Estimated effort to review (1-5, lower is better): 2