Repository navigation
Fix zip cleanup of pending source pulls - #144
Merged
vxgmichel merged 1 commit intoSep 14, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #144 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 15 15
Lines 1172 1174 +2
=========================================
+ Hits 1172 1174 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Owner
|
Great catch! Thank you @Kuang-xianxin It should be a general rule in the project that all the concurrency handling should go through I also checked that the test properly detects the original issue, so perfect, I'm merging it as it is :) |
Owner
|
Released in v0.8.0 🎉 |
This file contains hidden or 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
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.
When one source passed to
stream.zipends or raises while another source is still awaiting its next item,asyncio.gatherreturns without stopping that other pull. Its async generator remains running when the stream contexts exit, so itsfinallyblock is skipped and the pull can outlive the zip operation.Manage each round of pulls with the existing
TaskGroup. Pending pulls are cancelled and awaited before the source contexts close, while source order, strict length checks, and the original source exception are preserved.The event-controlled regression covers shortest-source exhaustion and source errors in both strict and non-strict mode. It checks that the pending generator's cleanup has completed and its task has finished when zip exits; no timing sleeps are needed.
Validation:
c098bec), then pass with the fix.test_utils.pyon both the base and the fixed tree.