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 and its concurrency tests, then implement the coalescing behavior and run the focused test suite.
- Assistant
The redundant work comes from each automatic trigger scheduling its own 100 ms retry whenever the shared offload mutex is busy. I’m checking the mutex/threading contract now so the replacement preserves manual offload’s immediate “already running” completion behavior while collapsing only automatic requests.
- Assistant
The implementation now uses a per-ledger automatic-offload state machine: one run owns the scan, all triggers during it share one pending follow-up, and that follow-up rescans ledger metadata after the active run completes. Manual offload still uses the existing mutex path and still fails immediately when another offload owns it. I’m compiling and running the existing auto/manual interaction tests next.
- Assistant
The focused module compilation is still in Gradle configuration/compilation with no errors emitted so far. While it runs, I’ve also checked that each caller-supplied automatic future is completed by the run it was coalesced into; the shared pre-completed background future does not drive the state transition.
- Assistant
Gradle is actively consuming CPU but remains silent during task-graph calculation, so I’m leaving it running rather than restarting it. The code path itself is now bounded: mutex retries belong to the single active automatic run, and repeated triggers no longer create independent timers.
- Assistant
The first Gradle invocation attempted a dependency connection during configuration, so I stopped it and restarted in offline mode to honor the no-internet constraint. Offline compilation is now progressing normally through the local dependency graph.
- Assistant
The complete
OffloadPrefixTestclass passes, including repeated automatic triggers and both manual/automatic overlap directions. I’m doing one final focused test of the caller-supplied automatic future path, then I’ll inspect the final diff.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.