Requestor pausing probably needs a rearchitect, or should be removed entirely #160
Labels
effort/weeks
Estimated to take multiple weeks
exp/wizard
Extensive knowledge (implications, ramifications) required
P2
Medium: Good to have, but can wait until someone steps up
This module supports pausing and resuming in a number of ways:
Of these, the requestor pause/unpause is by far the most complicated to implement, and produces unpredictable behavior.
Graphsync is designed to operate in an untrusted environment, and as such, responders can't simply accept commands from requestors to pause at any time (I could DDOS a respondering by simply telling them to respond to requests I kept pausing till they held too much memory for all my requests)
I explored a number of ways to implement this, and eventually settled on a requestor dealing with pause/unpause by simply cancelling the request and sending it again with a do-no-send-cids extension.
There are a number of problems with this:
Pause/Unpause is part of the protocol on the responder side. There is a response code that indicates a response has been paused, and a mechanism for the client to ask the responder to unpause. It makes sense to support pause/unpause on the responder side.
However, I think that pause/unpause for the requestor should not be part of go-graphsync. We should enable primitives to do do this via higher level code:
SendExtensionData(RequestID, ...ExtensionData)
This enables a few ways you might implement in go-data-transfer:
Note: this implementations may still require a fair amount of complexity, as any pause initiated on the requesting side must account for the responding side sending more data before it receives the pause request.
Alternatively, we can try to develop a pause /unpause request at the protocol level in go-graphsync so that we can at least more clearly define expected behavior.
The text was updated successfully, but these errors were encountered: