-
Notifications
You must be signed in to change notification settings - Fork 294
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
wip Flyte loop in FlyteContext & multi-threaded loops #2759
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Yee Hing Tong <[email protected]>
Signed-off-by: Yee Hing Tong <[email protected]>
Signed-off-by: Yee Hing Tong <[email protected]>
Signed-off-by: Yee Hing Tong <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## async/simple-te #2759 +/- ##
==================================================
Coverage ? 72.34%
==================================================
Files ? 195
Lines ? 19946
Branches ? 3929
==================================================
Hits ? 14430
Misses ? 4813
Partials ? 703 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Yee Hing Tong <[email protected]>
Signed-off-by: Yee Hing Tong <[email protected]>
Signed-off-by: Yee Hing Tong <[email protected]>
Signed-off-by: Yee Hing Tong <[email protected]>
Signed-off-by: Yee Hing Tong <[email protected]>
wild-endeavor
changed the title
wip Store Flyte loop in FlyteContext
wip Flyte loop in FlyteContext & multi-threaded loops
Sep 20, 2024
Signed-off-by: Yee Hing Tong <[email protected]>
Signed-off-by: Yee Hing Tong <[email protected]>
wild-endeavor
requested review from
kumare3,
eapolinario,
pingsutw,
cosmicBboy,
samhita-alla,
thomasjpfan and
Future-Outlier
as code owners
October 1, 2024 18:11
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a PR into #2752
Changes in this PR (move notes if merging)
Create a new loop at module load time that is stored in the FlyteContext but is
asyncio.set_event_loop
is intentionally not called.The idea here is that the loop is protected because it's stored in a contextvar and is not associated directly with the asyncio library. However I've seen already one error associated with not calling
set_event_loop
and others may crop up. Not sure what Jupyter is doing, but if you try to create a new loop in Jupyter, and call asyncio.set_event_loop, it doesn't actually overwrite the event loop. If you call get_running_loop before and after set, it remains the same. Been looking through their code but not sure how they achieved this, they don't seem to be doing anything special.Introduce a threaded coroutine runner, along with helper functions. Basically if already in an async context, and another async function needs to be called from within a synchronous function, then a new thread will be used to run that coroutine and corresponding loop.