fix: L1 drain chain silently breaks on lock conflict; flush never runs L1 (#549) - #757
Open
Schrotti77 wants to merge 1 commit into
Open
Conversation
…s L1 (TencentCloud#549) Defect 1: L1-drain task dropped after lock-conflict timeout, permanently breaking the drain chain (no supervisor, no L1_idle timer in hasFullBacklog branch). Now re-enqueued with bounded retries, then dead-lettered. Defect 2: /session/end flush only called handleSessionEnd (no L1 path) and cancelled the L1_idle safety timer. Now executeFlush delegates to executeL1. Closes TencentCloud#549
Collaborator
|
Thanks for your attention! We will schedule an internal review as soon as possible. |
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 #549
Defect 1: An L1-drain task is dropped after a lock-conflict timeout, permanently breaking the drain chain — there is no supervisor and no
L1_idletimer in thehasFullBacklogbranch, so a single drop silently stalls backlog draining for days while L0 capture keeps working.Fix: L1-drain tasks are now re-enqueued with bounded retries (maxRetries + 5), then dead-lettered. Re-enqueue is safe: L1 extraction is idempotent (upsert-by-record_id).
Defect 2: The
/session/endflush path only calledcore.handleSessionEnd— no code path in the flush flow ever ranrunL1WithStore, andflushSessionhad already cancelled theL1_idlesafety timer. Net effect: "idle-time catch-up extraction" became "idle-time extraction cancellation".Fix:
executeFlushnow delegates toexecuteL1, the same idempotent L1 path used by timer/drain triggers.Verification:
isL1DrainTaskregression test added (openclaw-plugin/tests/fix-549-l1-drain.test.ts).This matches the root cause confirmed by @Wilson-G in the issue (self-recursive flush chain, ~200ms cadence, 63 GiB log growth in 4 days) and aligns with the Fix 2 direction of #553 — offered as an independent reference implementation.