Repository navigation
refactor(layers)!: own timeout and retry operations and use the context timer in AIMD - #9577
Merged
Merged
Conversation
suyanhanx
approved these changes
Dec 3, 2026
PsiACE
approved these changes
Dec 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #9538.
Rationale for this change
Rust applications currently need types from the storage extension API to configure timeout overrides, implement a retry budget, or supply an AIMD timer. Each layer can expose its own supported operations and use the runtime resources configured on the operator.
What changes are included in this PR?
TimeoutOperationfor per-operation deadlines, including compose, and map Java's existing operation names to it in JNI.RetryOperationand use it inRetryBudgetandRetryEvent. Compose passes through the retry layer.Are there any user-facing changes?
AIMD needs a timer only if a request reaches the head of its FIFO queue and still has to wait for a token or for the cooldown to end. If the context executor supplies no timer in that case, AIMD returns a non-temporary
ErrorKind::ConfigInvalidbefore consuming a token or dispatching the request. Requests that can proceed as soon as they reach the head, and requests that bypass pacing, need no timer.The Rust upgrade guide covers timeout and retry operation imports and shows how to install a timer-capable executor. An external Rust caller exercised
Operator::statoutside Tokio, first with a timerless executor and then after installingCompioExecutorthroughOperator::with_context.Breaking changes
Affected packages: core
Migration:
TimeoutOperationvariant toTimeoutLayer::with_operation_timeout. Remove overrides forraw::Operation::Info, which has no deadline.RetryOperationinRetryBudget::deposit,try_reserve, andreleaseand when matchingRetryEvent::op. Import these enums fromopendal::layersor their respective layer crates. Include a wildcard arm when matching either enum.AimdLayerBuilder::with_sleep. If you used the hook or relied on the old Tokio fallback for timed waits at the head of the AIMD queue, supply a timer-capable executor withOperationContext::with_executorandOperator::with_context. If the operator uses the process-wide default, install a timer-capable default withExecutor::install_default. Custom executors supply timers throughExecute::sleep.AI Usage Statement
magpie/codex/gpt-6.2-astra. Effort:high. Role: traced the layer contracts and evaluated the API and timer behavior.magpie/codex/gpt-6.2-sol. Effort:max. Role: implemented the Rust and JNI changes, updated the migration guide, and verified the affected callers.gemini-4-neon. Effort:high. Role: copy-edited the PR text and Rust migration guidance.magpie/codex/gpt-6.2-sol. Effort:high. Role: independently reviewed the layer changes and verified timer behavior throughOperator::stat.