Repository navigation
fix(rpc): a plugin call waits until the plugin answers - #899
Merged
Merged
Conversation
A plugin method can hold response headers longer than the client-wide network progress window. Let rpc.call wait until the plugin answers, while retaining per-call windows and caller cancellation. Pin the behavior with a manual-clock regression and the watched upstream source, and document the timeout contract.
Collaborator
Author
|
net472 mutation proof on
Together with the net10.0 and net11.0 runs in the description, the test fails on every target the rule ships on. |
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.
Closes #868
What
rpc.callanswers only when the plugin's handler returns, or when the routing cache closes the RPC (rpc.unavailable). A long-lived plugin method therefore holds the response headers for as long as it runs. The SDK applied the client-wideNetworkTimeout(100 s by default) to it and cut a healthy call. opencode's own client sets no timeout on this call: the caller's signal is its only deadline.rpc.callnow joins the operations that answer only when their work ends. It runs with no network window unless the call sets one, and the cancellation token is its deadline. A per-callNetworkTimeoutstill bounds it.Changes
OperationTraits: one row,rpc.callwithHasNoNetworkWindow: true.NetworkTimeoutTests: a manual-clock test. The handler holds its answer, the clock passes the client window, the exchange's token stays uncancelled, and the released answer comes back whole. The existing never-answering handler becameHoldingHandler, which a test can release; the existing cut tests never release it.NetworkTimeoutTests,HandWrittenTransportTableTests) gainrpc.call.client-runtime.md, the requests guide ("Eight calls", plus aclient.Rpc.CallAsyncbullet), theOpenCodeClientOptions.NetworkTimeoutXML documentation and theNetworkTimeoutsremarks.packages/core/src/rpc.tsat v2.3.0, anchored on the comment that a long-lived RPC releases its location when the routing cache invalidates it. The receipt was regenerated at the same pin: no operation changed and the anchor matched.Verification
rpc.callrow removed, the new test fails on net10.0 and net11.0 atAssert.That(sentUnder.IsCancellationRequested).IsFalse(), not by a hang guard. With the row restored, the file is byte-identical.format whitespaceandformat style, Slopwatch, clone gate,generate --verify,refresh-spec --verify, and both packs all pass;Channel. A focused recheck then passed: the mutant red run, build, net472 build (0 warnings), formatting, Slopwatch, clone gate, 8,474 SDK tests and the clean tree.