-
Notifications
You must be signed in to change notification settings - Fork 16
Refactor initial file information handling while avoiding asyncio issues.
#701
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
Merged
tasansal
merged 15 commits into
TGSAI:main
from
dmitriyrepin:bug-613_handles_not_cleaned_take_3
Oct 8, 2025
Merged
Refactor initial file information handling while avoiding asyncio issues.
#701
tasansal
merged 15 commits into
TGSAI:main
from
dmitriyrepin:bug-613_handles_not_cleaned_take_3
Oct 8, 2025
Conversation
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
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #701 +/- ##
==========================================
+ Coverage 85.30% 88.84% +3.53%
==========================================
Files 46 84 +38
Lines 2219 4519 +2300
Branches 306 296 -10
==========================================
+ Hits 1893 4015 +2122
- Misses 281 435 +154
- Partials 45 69 +24 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
tasansal
suggested changes
Oct 7, 2025
9d9fb29 to
8cae547
Compare
…bject for cleaner function signatures and consistent data access
…sistency with SegyFileInfo usage
…with SegyFileInfo usage
…roved clarity and consistency
…nes and future type checking compatibility
…nd compliance with TYPE_CHECKING
asyncio issues.
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 an ugly fix for the bug 613 Open handles not properly cleaned up
BACKGROUD:
Invoking any Zarr cloud-accessing code in the same process as any code directly using fsspec (e.g.,
SegyFile) results in theRuntimeError "Task attached to a different loop" (see Zarr issue #3487).
MDIO uses Xarray (which uses Zarr under the hood) to create or read MDIO cloud datasets from the main process.
To avoid the RuntimeError "Task attached to a different loop", no code using fsspec is permitted in the MDIO main process. Since
SegyFiledirectly access fsspec, theSegyFilecan't be instantiated in the main process.WORKAROUND
This PR uses a
ProcessPoolExecutor(max_workers=1)to read all information that MDIO needs from theSegyFilein a separate process usinginfo_worker(theinfo_workerand its dependencies are currently placed in src/mdio/segy/_workers.py, but can be moved to other location)