Automatic managed-ledger offload triggers create redundant retry work Coalesce automatic…
- User
Automatic managed-ledger offload triggers create redundant retry work
Coalesce automatic offload triggers while an automatic offload is running. There must be at most one active automatic run and at most one follow-up run when additional triggers arrive. A follow-up must still process newly eligible ledgers, and explicit/manual offload futures must retain their existing behavior.
Interface
No new public interfaces are introduced.
- Assistant
I’ll trace the managed-ledger offload trigger path, identify the concurrency boundary between automatic and explicit runs, then patch and run the focused tests.
- Assistant
rgisn’t installed in this checkout, so I’m switching to targetedfind/grepsearches and keeping the inspection scoped to managed-ledger code. - Assistant
The retry storm is in
maybeOffload: every automatic trigger independently polls the shared offload mutex every 100 ms. I’m replacing that with a per-ledger automatic-run state machine: one current run, one coalesced pending run, while leaving the manualasyncOffloadPrefixlock/failure contract unchanged. - Assistant
The first test command assumed a Maven wrapper, but this checkout doesn’t include one. I’m using the repository’s available build tooling next, then I’ll add a focused regression assertion if the existing coverage can’t observe run coalescing directly.
- Assistant
The focused suite is still in Gradle configuration/compilation with no failures reported. While it runs, I’m checking the state transitions for completion races and ensuring coalesced trigger futures are completed by the follow-up run rather than prematurely by the active run.
- Assistant
The existing tests already cover “newly eligible ledgers are picked up” and manual-vs-automatic future behavior. I added one focused regression test that blocks the active run, fires many automatic triggers, and verifies they do not create independent policy-check/retry loops; it also verifies all coalesced trigger futures finish after the follow-up.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.