fix: prevent mv lock timeout causing missing L0/L1 files#1064
Open
r266-tech wants to merge 1 commit intovolcengine:mainfrom
Open
fix: prevent mv lock timeout causing missing L0/L1 files#1064r266-tech wants to merge 1 commit intovolcengine:mainfrom
r266-tech wants to merge 1 commit intovolcengine:mainfrom
Conversation
Two-part fix for SemanticProcessor failing to move generated layer
files (.abstract.md, .overview.md) from temp to target directory.
1. Change default lock_timeout from 0.0 to 5.0 (seconds)
- LockManager and TransactionConfig both defaulted to 0.0,
meaning any lock contention caused immediate failure
- Updated to 5.0s: enough for transient contention, not so
long that a real deadlock blocks indefinitely
- Users can still set lock_timeout=0 for fail-fast behavior
2. Add retry logic with backoff for mv operations in
SemanticProcessor._sync_topdown_recursive()
- New _mv_with_retry() helper: retries up to 3 times with
increasing delay (0.3s, 0.6s, 0.9s) on lock errors
- Applied to all 4 viking_fs.mv() call sites
- Logs warning on each retry attempt for debugging
Closes volcengine#1047
|
|
|
Failed to generate code suggestions for PR |
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.
Closes #1047
Problem
The SemanticProcessor fails to move generated
.abstract.md(L0) and.overview.md(L1) files from the temp directory to the target resource directory. Server logs show"Failed to acquire mv lock"errors, resulting in missing layer files even though the VLM successfully generated them.Root cause: Two compounding issues:
TransactionConfig.lock_timeoutandLockManagerboth default to0.0, meaning any lock contention causes immediate failure — no waiting, no retry.SemanticProcessor._sync_topdown_recursive()has no retry logic aroundviking_fs.mv()calls. When concurrent operations compete for subtree locks, the first contention kills the move.Fix
1. Change default
lock_timeoutfrom0.0to5.0(seconds)Updated in both
TransactionConfigandLockManager/init_lock_manager. Five seconds is enough for transient contention to clear without causing indefinite blocking on real deadlocks. Users who want fail-fast behavior can still setlock_timeout=0.2. Add retry logic with backoff for mv operations
New
_mv_with_retry()helper insemantic_processor.py:Applied to all 4
viking_fs.mv()call sites in_sync_topdown_recursive().Changes
openviking_cli/utils/config/transaction_config.pylock_timeout:0.0→5.0openviking/storage/transaction/lock_manager.pylock_timeout:0.0→5.0(2 locations)openviking/storage/queuefs/semantic_processor.py_mv_with_retry()helper, 4 call sites updated3 files changed, +37/-13