Repository navigation
fix: return None for missing keys in LocalStore batch reads - #4707
Open
zengyuanzhao wants to merge 10 commits into
Open
zengyuanzhao wants to merge 10 commits into
zengyuanzhao wants to merge 10 commits into
Conversation
added 9 commits
December 3, 2026 16:56
zengyuanzhao
marked this pull request as ready for review
December 5, 2026 06:12
This branch has not been deployed
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.
Summary
Fixes #4706
Refs #2614
While reviewing
LocalStoretest coverage, I found that the existing batch-read test wrote every key it requested. Adding a missing key between two byte ranges from the same file caused the entire batch to raiseFileNotFoundError. With this fix, reading the first two bytes ofb"NAME", a missing key, and the last two bytes returns[b"NA", None, b"ME"]in request order.LocalStore.get_partial_values()still reads concurrently. It consumes the input iterable before scheduling reads, so if iteration fails, the original exception propagates and no reads start.For reviewers
Please check how the code distinguishes a missing key from an inaccessible file or store.
PermissionError, as it can for a directory on Windows, the helper returnsNoneonly after confirming the path is a directory. Permission errors on regular files and errors from buffer construction propagate.None. If an open store’s root is renamed, both writable and read-only stores raiseFileNotFoundErrorwith the original root path infilename. Replacing the root with a regular file raisesNotADirectoryError. Only an unopened writable store permits an absent root, and the batch read leaves it absent.Verification at
a414136PermissionError.groupandgroup/chunktogether returned[None, b"data"].get_sync(), asynchronousget(), and aget_partial_values()batch that also included a readable file all raisedPermissionError(errno=13) withfilenamepointing to the denied file.Author attestation
Prepared with Codex assistance.