-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RPC timeout implementation #513
Conversation
When this is integrated into the handlers, does this need to be rebased on top of #509? |
@tegefaulkes can you also flesh out the remaining tasks here, and what tests you have. |
348f26f
to
52d9186
Compare
Re-based on #509 |
6028a7d
to
000b16a
Compare
043066d
to
60e3d13
Compare
This needs to be rebased on staging after the recent merge. Doing that now. |
* updated `@matrixai/timer` to `1.1.0` * updated `@matrixai/async-cancellable` to `1.0.4` [ci skip]
9675afc
to
5a7c48c
Compare
Cleaned up the commit history and re-based on staging. I'll check for any problems that the re-base may have introduced and then work on the |
|
I can't use the |
It is possible to abort a webstream. I've been doing it with This comes with a small problem. It is possible to provide a reason for abortion. But this reason isn't being propagated through the stream. Aborting the stream this way results in the error Ultimately this means our abort or timeout reason won't be thrown if the stream times out like this. Not through the streams at least. |
You don't need to use the decorators. Use the HOF variant OR you can just construct the object yourself and maintain lifecycle somehow. Those were intended for convenience of thing it to the function scope context. But your timer object should be tied to the stream life cycle. |
|
Few notes.
To emphasise point 2. the
Point 2. is needed for the timeout mechanism to work properly. From the Due to how stream locking works and composing, you can't really interact with a stream from the middle. And from the The only option left is to have the transport layer respect a signal and terminate the stream. |
When creating the based on previous discussion I'll look into adding it in if only for debug usage. |
From the client caller method's perspective, there are two kinds of timers, one that was provided and a default timer. If we provide a timer when making a call, I'm not sure we want to be refreshing when messages are sent. If we are composing multiple actions under a single timeout, we don't want an rpc call to mutate it. We may also want it to. So the question is, do we want to enable refreshing implicitly based on if the timer was provided, or based on an option or both? Right now I'm thinking, it will do refreshing if it's using the default timer, or not do refreshing if a timer was provided. This can be overridden with an option. |
Quick note, if a So if you create a
|
Its the job of the caller when passing in the |
|
Ready for review? Should we skip the agent migration or should just be merged? I think after this you should go straight to QUIC so we can start on it. |
For duplex and client streaming it is required that the user manually cleans up streams. [ci skip]
[ci skip]
#513 (comment) [ci skip]
[ci skip]
[ci skip]
…dableWritablePair` and includes a `cancel(reason?: any)` method and generic metadata - created `RPCStream` interface, updating code - fixing tests - client now includes metadata in remote errors - `RPCServer` includes metadata in the `RPCStream` and propagates cancel/meta to middleware - improved cancellation feature of the server `RPCStream` [ci skip]
671cd10
to
f5030d6
Compare
Fixed up and ready to merge. |
Nice! |
Hey I think |
Description
This PR handles adding the timeout features to the agnostic RPC system
Issues Fixed
@streamparser/json
results in error when usingtsc
orjest
relying ontsc
#516Tasks
RPCServer
to support timeouts.RPCClient
to support timeouts.ctx
.5. Update agentHandlers to make use of the new cancellation/timeoutThis is blocked by Agent RPC migration #512ctx
.RPCClient
andRPCServer
. support updating the timeouts based on these communicated values.WebSocketClient
to take actx: ContextTime
and allow it to abort the current connection.Final checklist