-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Remove http client timeout code #2974
Comments
|
sound good to me! |
Timeout should definitely be sent to the server. In the few places we had timeout implemented in the client I believe we are (or were) sending it anyway. 👍 I'd love to see it implemented in js-ipfs. |
Ah, I see - I think we used to, but when |
SGTM. I prefer implementing the timeout on both, just to be safe, but sending the timeout to the server gives the server some information on how long the client wishes to spend performing the request. |
ipfs-http-client
adds atimeout
option to all requests which uses an AbortController to abort the request from the client side once the timeout is reached.This conflicts with
go-ipfs
' globaltimeout
option which causes the request to be aborted from the server side once the timeout is reached.I propose we remove the timeout from the client side and implement the server side version in js-ipfs. This is local RPC, not a public facing API (in theory) so long running requests should be ok, and if client-side timeouts are important the user can implement them by using an AbortController.
One caveat is that on the CLI
go-ipfs
returns a non-zero exit code when the timeout is reached, over HTTP it (probably) sends an error in the trailers for streaming responses, which we know no browser supports, so it looks like the request ends normally. When we implement the ndjson value/error wrappers discussed at the IPFS team week earlier in the year it'll throw instead of truncating the stream.Thoughts, objections etc? @hugomrdias @alanshaw
The text was updated successfully, but these errors were encountered: