[common] Reuse the file system built by the FileIO access check - #9471
Closed
wombatu-kun wants to merge 1 commit into
Closed
[common] Reuse the file system built by the FileIO access check#9471wombatu-kun wants to merge 1 commit into
wombatu-kun wants to merge 1 commit into
Conversation
This was referenced Aug 30, 2026
Contributor
|
FileIOLoader.load does not guarantee the return of a fresh or exclusive instance; the new tests also explicitly treat the return of a singleton as valid. The solution is simple, never let fs..impl.disable.cache=true, I feel the changes in this PR are pointless, and I don't want to waste any more time on it. |
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.
Purpose
Split out of #8962 at @JingsongLi's request. Answers this review comment.
FileIO.getprobes a loader by callingload(path), configuring the result and callingexists, then discards it and callsloadagain for the instance it returns. EveryFileIO.gettherefore builds the file system twice for the same path, and withfs.<scheme>.impl.disable.cache=truethe first one is unreachable afterwards.checkAccessnow returns the instance it checked andgethands that one back, releasing it if the candidate is rejected or the selection throws. That also covers the reviewer's point thatFileIOLoader.loadis@Publicand may return a cached instance, so closing the probe and reloading could hand back a closed one.Its return type changes from
FileIOLoadertoFileIO, a@Publicsignature change with no other caller in the repo.Tests
FileIOTest: the checked instance is handed back rather than reloaded and configured twice, and it is released when its loader is dropped for missing options or whenrequiredOptions()throws.