Repository navigation
Handle missing cache files in generate_fingerprint (#9103) - #9111
Open
zhengdaodeguL wants to merge 1 commit into
Open
zhengdaodeguL wants to merge 1 commit into
zhengdaodeguL wants to merge 1 commit into
Conversation
Use a random fingerprint when a cache file has disappeared so stale paths cannot produce an unsafe reusable cache identity. Keep timestamp hashing unchanged for intact files and log the fallback. Thanks to PCTEJA for reporting the issue.
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.
Fixes #9103
generate_fingerprint()hashed cache-file modification times with no existence check, so a routine cache-state change — a user,cleanup_cache_files, or another process deleting a cache file — turned into a hardFileNotFoundErroratDatasetconstruction time, naming an internal cache path.The fix catches the missing file, logs a warning naming it, and returns a fresh random fingerprint. A random fingerprint is the safe fallback: it cannot collide with another dataset's cache identity, so the dataset is recomputed rather than loading stale results. Fingerprint behavior for intact cache files is unchanged.
Thanks to PCTEJA for reporting the issue with a precise root-cause analysis.
Verification
tests/test_fingerprint.py: the reporter's repro (deleted cache file, with and without indices) no longer crashes and yields a fresh random fingerprint each call, with the warning logged;Datasetconstruction against a missing cache file gets a valid fingerprint; and mtime-based fingerprinting for intact files is unchanged. All 5 pass; the 3 missing-file cases fail on base (verified with a source-only base control).rufflint/format clean.