-
Notifications
You must be signed in to change notification settings - Fork 13
Better handoff to async code #624
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
Conversation
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.
Pull Request Overview
This PR replaces top-level make_sync usage with direct async calls executed via _async_execute_and_wait to avoid event‐loop conflicts.
- Swapped
make_syncforget_servicex_sample_title_limitwith an async wrapper. - Updated
deliver()to invoke the async URL and file retrieval methods through_async_execute_and_wait.
Comments suppressed due to low confidence (2)
servicex/servicex_client.py:186
- [nitpick] Consider adding a unit test for the new async path in fetching the sample title limit to verify correct behavior and error handling under different event-loop scenarios.
title_length_limit = _async_execute_and_wait(
servicex/servicex_client.py:307
- [nitpick] Calling
_async_execute_and_waitrepeatedly may incur overhead by starting new loops or tasks each time. If you make multiple async calls in sequence, consider batching them or reusing the same event loop to improve performance.
group.as_files_async(
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #624 +/- ##
=======================================
Coverage 96.49% 96.49%
=======================================
Files 29 29
Lines 1939 1939
=======================================
Hits 1871 1871
Misses 68 68
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f87bcf9 to
1b56f65
Compare
for more information, see https://pre-commit.ci
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.
Ah, this seems so much more sane
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.
Makes sense! Async deep down...
It seems that
make_synccan have bad interactions with other code that sets up event loops and should really only be used for top-level interfaces. Change a couple of places to use async versions of functions, run viaasyncio.This is needed to fix the failures in the production tests.