[IO] Add FILE_SHARE_READ for read-only opens on Windows#24005
Closed
jtuyls wants to merge 2 commits intoiree-org:mainfrom
Closed
[IO] Add FILE_SHARE_READ for read-only opens on Windows#24005jtuyls wants to merge 2 commits intoiree-org:mainfrom
jtuyls wants to merge 2 commits intoiree-org:mainfrom
Conversation
Without FILE_SHARE_READ, opening the same file twice for reading on Windows fails with ERROR_SHARING_VIOLATION. Add a test that reproduces this and a commented-out fix to enable after CI confirms the failure. Signed-off-by: Jorn <jorn.tuyls@gmail.com>
a8389f3 to
d70b1e5
Compare
Uncomment the fix now that CI confirmed the test failure on Windows. Signed-off-by: Jorn <jorn.tuyls@gmail.com>
Contributor
Author
|
Closing as I should just use IREE_IO_FILE_MODE_SHARE_READ in call site. |
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.
On Windows, files opened for reading cannot be opened again by another reader — the second open fails with ERROR_SHARING_VIOLATION. This breaks workflows where multiple IREE sessions load the same parameter file (.irpa).
The first commit adds a test that reproduces the failure — confirmed on Windows CI: https://github.com/iree-org/iree/actions/runs/23940576218/job/69825870972
The second commit enables the fix: add FILE_SHARE_READ to read-only opens, matching POSIX behavior where multiple readers are always allowed.