Repository navigation
fix(outcalls): stop waiting for the transform at the outcall's deadline - #12121
Merged
Merged
Conversation
The client already stops waiting for the adapter at an outcall's effective deadline (#11932), but still awaits the transform without one. Apply the same deadline to the transform: the client gives up with the same "Deadline Exceeded" reject, and dropping the call makes the query handler skip the transform if it hasn't started. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Deadline expiry can be incorrectly replaced by a SysFatal response-size error when max_response_bytes is below 17, causing inconsistent rejects between timeout paths.
1 open issue
What changed in this PR
Extends the HTTPS outcall deadline introduced in #11932 to response transforms, so the client stops waiting once the outcall’s remaining time expires.
Changes:
- Passes a shared deadline to transform execution and returns a deadline reject on timeout.
- Drops timed-out transform calls, allowing queued work to be skipped.
- Adds a regression test covering timeout rejection, cancellation, and request-slot reuse.
| File | Description |
|---|---|
rs/https_outcalls/client/src/client.rs |
Applies the outcall deadline to transforms and tests timeout handling and slot reuse. |
Review effort: Balanced
Giving up on a transform that is already running doesn't stop it, and its instructions then go unreported, so it would go uncharged under pay-as-you-go pricing. The query handler and the client now decide once, via `TransformStart`, whether a transform runs: if the client gives up first at the deadline, the query handler skips the transform; if the transform has started, the client waits for it to finish and charges for it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The query handler and the client do the same thing: claim the transform, and only the first claim succeeds. The call sites say what each claim means. Also replace the query handler's stale comment about a weak pointer: the closures check whether the caller dropped the call. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
✅ No security or compliance issues detected. Reviewed everything up to f27ad66. Security Overview
Detected Code Changes
|
pierugo-dfinity
approved these changes
Nov 18, 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.

Follow-up to #11932, which made the HTTPS outcalls client stop waiting for the adapter at an outcall's effective deadline. The transform that follows is still awaited without a deadline. A transform that hasn't run by the deadline is wasted work: consensus has already timed the outcall out and drops its result.
This PR applies the same deadline to the transform:
SYS_TRANSIENT"Deadline Exceeded" reject. The query handler then skips it.TransformStartinTransformExecutionInput, which of the two happens, so a transform can't start after the client has given up on it.Behavior changes:
Tests (client):
test_client_stops_waiting_for_transform_at_request_deadline: a transform that never starts is given up on at the deadline with the deadline reject, and the query handler would skip it. On master the client keeps waiting.test_client_waits_for_transform_started_by_request_deadline: a transform that starts before the deadline but finishes after it is waited for, and charged under pay-as-you-go pricing.🤖 Generated with Claude Code