Replies: 3 comments 2 replies
-
I'm not certain we need to bring in any additional complexity for the sake of cancelling a message that has been partially sent to the mux/bearer. It's seems plausible that we can instead mitigate the associated risks by bounding the size of message that are sent (message size is something both parties are very much aware before anything is even requested in all of our data-intensive mini protocols) |
Beta Was this translation helpful? Give feedback.
-
|
For the specific motivating use case I have in mind---ie |
Beta Was this translation helpful? Give feedback.
-
|
As a result of those two observations, I don't feel particularly well-positioned to comment further on this design. If I've understood it correctly so far, it's more general than the only use-case I can afford to give much thought to right now :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Protocol Message Cancellation Design
Egress
The egress queue can be a list of lazy
ByteString, each onecorresponding to a single
sendcall (e.g. an encoding of a single message).MuxSDUgets a new fieldgeneration :: Word32. It is added to inform theremote end when a cancellation happened.
When cancelling a message, we'd remove the last enqueued
ByteString(especially ifit was partially consumed/sent), and increment the
generationfield. When the nextMuxSDUis sent, the receiver will need to restart its incremental parser.Ingress
0).with a boolean flag:
Driver
On the driver side, whenever
Restartedis received, we return fromrunDecodeStepwith the received bytes, and restart the incremental decoding, feeding it with the received bytes.TypedProtocols
We would need a new TypedProtocols API which allows us to cancel previous
message and go back one step.
The current
Peertype doesn't allow us to implementCancel, since we don'tstore previous states. Once we
Yield/PipelinedYielda message, we move the protocolforward.
The branch contains a more explicit pipelining scheme,
where at the type level we remember a list of pipelined transitions, e.g.
Note: ignore the
stmparameter, the branch contains more features than we would need...When we pipeline
Message ps st st', the continuation state isq |> Tr st' st''. From this alone, we cannot restore the state toClient ps Pipelined q st m stm a, but if we also storestin theTrtype constructor, wecould (I have not assessed the consequences of such a change). This would allow us to cancel requests that were pipelined, but not
pipelined requests, but not ordinary ones. Maybe this is enough. A more direct approach could also be possible. However, the challenge is how many previous states we need to remember; tying this to the pipelining depth seems like a reasonable compromise.
Here is how
YieldPipelinedandCancelledPipelinedYieldcould look:Beta Was this translation helpful? Give feedback.
All reactions