Repository navigation
fix(session): requeue Phase 2 on lock contention and pause before requeue - #6083
Open
OnePerson2020 wants to merge 1 commit into
Open
OnePerson2020 wants to merge 1 commit into
OnePerson2020 wants to merge 1 commit into
Conversation
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.
Description
LockAcquisitionErrorin Phase 2 no longer fails the archive:_run_memory_extractionre-raises it without writing.failed.jsonor failing the task, andresume_queued_commitreturnsFalse, soSessionCommitProcessorrequeues the message. Completed steps are already checkpointed incompleted_memory_steps, so the rerun continues where it stopped.SessionCommitProcessorpauses 2 s before re-enqueueing a commit that has to wait (predecessor pending or lock contention), instead of cycling it continuously (the embedding processor already sleepsretry_afterbefore re-enqueueing).Human Involvement
Related Issue
Fixes #6082
Type of Change
Changes Made
session.py:except LockAcquisitionErrorbefore the generic handler in_run_memory_extraction(telemetry + warning, re-raise);resume_queued_commitmaps it toFalse.session_commit_processor.py:await asyncio.sleep(_REQUEUE_DELAY_S)(2 s) before the re-enqueue.test_phase2_lock_contention_requeues_without_failing_archive;test_process_requeues_deferred_commit_and_resets_root_contextnow also checks the pause comes before the enqueue.Testing
resume_queued_commitreturnsTrueafter marking the archive failed; no pause before the enqueue); with it they pass.tests/unit/session,tests/sessionand the processor tests, the set of other failures is identical before and after the change in my environment (vectordb-engine / full-config tests;test_session_commit_race.pyhangs on main locally, so it is excluded). Ruff andgit diff --checkclean.Checklist
Additional Notes
No API or data-format change; no new dependency.
🤖 Generated with Claude Code