Repository navigation
Keep LAN hash cache across install moves; name the file in walk errors - #613
Open
aidankinzett wants to merge 1 commit into
Open
aidankinzett wants to merge 1 commit into
aidankinzett wants to merge 1 commit into
Conversation
The LAN manifest hash cache is keyed by absolute path, so moving a game's install folder made every cached hash miss and the next /manifest request re-hashed the whole game (185 GB took ~13 min, with the peer waiting on it). After a move, move_install now calls lan::server::on_install_moved, which rekeys the cache entries from the old folder to the new one, persists the cache, and starts a background manifest prep. Mtimes are carried over, so a same-filesystem rename hits the cache; a cross-device copy changes mtimes and those files are re-hashed as before. A single unreadable file fails the whole walk. The error now includes the file's path relative to the install folder instead of only the OS error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
This branch was successfully 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.
Problem
The LAN manifest hash cache (
HashCacheinlan/server.rs) is keyed by absolute file path. Moving a game's install withmove_game_installchanged every path, so every cached hash missed, and the next peer/manifestrequest re-hashed the whole game. For a 185 GB install that took about 13 minutes, and the peer's request waited on it.Separately, one unreadable file fails the whole walk, and the 500 / log line gave only the bare OS error, e.g.
os error 225when Windows Defender blocked a read. It didn't say which file failed.Changes
lan::server::on_install_moved(called at the end ofmove_game_install) rekeys cache entries under the old folder to the same relative paths under the new folder, persists the cache, then callsspawn_manifest_prepso the first peer request finds the manifest ready. Mtimes are carried over: a same-filesystem rename keeps them, so the entries hit. A cross-device copy changes them, so those files are re-hashed on the next walk, the same as before.walk_game_files_with_hashesprefixes metadata and hash read errors with the file's path relative to the install folder.rekey_cache_entries, including a sibling folder that shares a name prefix with the old folder (it must not be moved).Testing
cargo fmt,cargo clippy --all-targets -- -D warningspass (Windows).cargo testnot run locally (Windows; no WSL on this machine). CI's Linux job runs the new test.🤖 Generated with Claude Code