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 search the codebase for managed-ledger offload trigger logic and how automatic vs manual runs are handled.
- Assistant
Implementing coalescing for automatic offload triggers: one active run and at most one follow-up.
- Assistant
Adding a focused test and a
@VisibleForTestinghelper to verify coalescing behavior. - Assistant
Automatic managed-ledger offload triggers are now coalesced instead of each one scheduling its own 100ms retry.
Problem
When
maybeOffload()couldn't acquireoffloadMutex(because an offload was already running), it scheduled a separate 100ms retry per trigger:// OLD behavior - each trigger scheduled its own retry scheduledExecutor.schedule(() -> maybeOffloadInBackground(finalPromise), 100, TimeUnit.MILLISECONDS);
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.