fix: PID lock recycle, recall threshold bypass, orphaned compressor refs#1211
Open
JasonOA888 wants to merge 2 commits intovolcengine:mainfrom
Open
fix: PID lock recycle, recall threshold bypass, orphaned compressor refs#1211JasonOA888 wants to merge 2 commits intovolcengine:mainfrom
JasonOA888 wants to merge 2 commits intovolcengine:mainfrom
Conversation
1. process_lock: verify PID is actually OpenViking on Linux by checking
/proc/{pid}/cmdline. Prevents false DataDirectoryLocked when PIDs are
recycled to unrelated processes after crash (Fixes volcengine#1088).
2. memory-ranking: add scoreThreshold param to pickMemoriesForInjection
and filter non-leaf items below threshold. Previously low-scoring
memories bypassed recallScoreThreshold when supplementing leaves
(Fixes volcengine#1106).
3. compressor: catch FileNotFoundError separately in _merge_into_existing,
clean up orphaned vector records so they are not retried indefinitely
(Fixes volcengine#1048).
PR Code Suggestions ✨No code suggestions found for the 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.
Fixes #1088, Fixes #1106, Fixes #1048
Bug 1: PID lock recycle → cascading Gateway failure (#1088)
On Linux, PIDs are recycled. After an OpenViking crash,
_is_pid_alive()checksos.kill(pid, 0)which returns True for any process with that PID — not just OpenViking. This causesDataDirectoryLockedfor an unrelated process, which cascades into unhandled promise rejections and session deadlock in the OpenClaw Gateway.Fix: After
os.kill(pid, 0)succeeds on Linux, verify the process is actually OpenViking by reading/proc/{pid}/cmdline. If it's not an OpenViking process, treat the lock as stale and reclaim it.Bug 2: recallScoreThreshold bypassed (#1106)
postProcessMemoriescorrectly filters by score threshold, butpickMemoriesForInjectionbypasses it when supplementing leaf memories with non-leaf items. The fallback loop at line 258 pushes items without checkingclampScore(item.score) < scoreThreshold.Fix: Add
scoreThresholdparameter topickMemoriesForInjection(default 0 for backward compat) and check threshold in the supplementation loop.Bug 3: Compressor infinite retry on orphaned refs (#1048)
When a memory file is deleted externally (e.g., manual cleanup),
_merge_into_existingfails with a generic exception and returns False. The caller skips the merge but the orphaned reference stays in the compressor's tracking state, causing retries every few minutes indefinitely.Fix: Catch
FileNotFoundErrorseparately, log a warning, and clean up the orphaned vector record viavikingdb.delete_urisso it won't be retried.Testing
ast.parse