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 locate the managed-ledger automatic offload trigger logic and how retries are scheduled so we can coalesce them without changing manual offload behavior.
- Assistant
Implementing coalescing for automatic offload triggers: adding state tracking and updating
maybeOffload/maybeOffloadInBackground. - Assistant
Fixing follow-up scheduling so we don't schedule a retry while an automatic offload is already running.
- Assistant
Automatic managed-ledger offload triggers are now coalesced so redundant retry work is avoided.
Problem
When multiple automatic offload triggers arrived while an offload was already running, each one scheduled its own 100ms retry via
maybeOffloadInBackground. That could queue many redundant executor tasks and scheduled retries.Solution
In
ManagedLedgerImpl, automatic triggers (NULL_OFFLOAD_PROMISE) now share coalescing state:automaticOffloadRunning— tracks an active automatic offload- — records that a follow-up is needed
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.