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 coalescing without changing manual-offload future semantics.
- Assistant
rgisn’t installed in this checkout, so I’m switching to targetedfind/grepsearches and keeping the scope to managed-ledger implementation and tests. - Assistant
The current behavior retries every automatic trigger independently whenever the shared offload mutex is busy. I’ve isolated the fix to an automatic-run state machine: one runner owns mutex retries, concurrent triggers collapse into one pending scan, and manual calls continue to fail fast with
OffloadInProgressExceptionas before. - Assistant
The implementation now keeps per-trigger futures attached to either the active automatic scan or the single coalesced follow-up, so callers still receive completion while redundant scans disappear. I’m running the existing offload concurrency suite next, including manual-vs-automatic interactions and newly eligible ledger coverage.
- Assistant
The targeted suite is still in Gradle’s initial configuration/compilation phase (this checkout uses Gradle rather than Maven). While it runs, I’ve also checked the key race: triggers arriving during handoff are atomically assigned to the pending run, and each follow-up rescans the live ledger map rather than reusing the first run’s candidate queue.
- Assistant
Gradle attempted to resolve a build plugin remotely during configuration. I’m stopping that attempt to honor the no-internet constraint and rerunning in offline mode; if the plugin is not cached, I’ll report that local infrastructure limitation separately from code verification.
- Assistant
The full
OffloadPrefixTestsuite passes offline, including existing multi-trigger and manual/automatic concurrency cases. I’m doing the final static checks and diff review now.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.