Skip to content

Conversation

@ponyisi
Copy link
Collaborator

@ponyisi ponyisi commented Jul 15, 2025

It seems that make_sync can 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 via asyncio.

This is needed to fix the failures in the production tests.

Copy link
Contributor

Copilot AI left a 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_sync for get_servicex_sample_title_limit with 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_wait repeatedly 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
Copy link

codecov bot commented Jul 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.49%. Comparing base (196629e) to head (531aa45).
Report is 2 commits behind head on master.

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           
Flag Coverage Δ
unittests 96.49% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ponyisi ponyisi force-pushed the more-async branch 2 times, most recently from f87bcf9 to 1b56f65 Compare July 15, 2025 16:22
Copy link
Contributor

@BenGalewsky BenGalewsky left a 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

Copy link
Collaborator

@gordonwatts gordonwatts left a 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...

@ponyisi ponyisi merged commit 1bcbb49 into master Jul 16, 2025
37 checks passed
@ponyisi ponyisi deleted the more-async branch July 16, 2025 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants