Skip to content

fix: L1 drain chain silently breaks on lock conflict; flush never runs L1 (#549) - #757

Open
Schrotti77 wants to merge 1 commit into
TencentCloud:feat/server_teamfrom
Schrotti77:fix/549-l1-drain-resilience
Open

fix: L1 drain chain silently breaks on lock conflict; flush never runs L1 (#549)#757
Schrotti77 wants to merge 1 commit into
TencentCloud:feat/server_teamfrom
Schrotti77:fix/549-l1-drain-resilience

Conversation

@Schrotti77

Copy link
Copy Markdown

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_idle timer in the hasFullBacklog branch, 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/end flush path only called core.handleSessionEnd — no code path in the flush flow ever ran runL1WithStore, and flushSession had already cancelled the L1_idle safety timer. Net effect: "idle-time catch-up extraction" became "idle-time extraction cancellation".
Fix: executeFlush now delegates to executeL1, the same idempotent L1 path used by timer/drain triggers.

Verification: isL1DrainTask regression 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.

…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
@Maxwell-Code07

Copy link
Copy Markdown
Collaborator

Thanks for your attention! We will schedule an internal review as soon as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

L1 提炼链路有两个相关的健壮性缺陷,叠加后会导致 L1 提炼静默停摆数天,而 L0 捕获一切正常,用户难以察觉

2 participants