origin-js icon indicating copy to clipboard operation
origin-js copied to clipboard

IpfsService#getListing hangs for >10s when given invalid hash

Open aiham opened this issue 7 years ago • 3 comments

Should probably time out earlier than this and reject the promise.

aiham avatar Mar 10 '18 06:03 aiham

ContractService#getListing too

aiham avatar Mar 10 '18 12:03 aiham

@aiham If we go ahead with removing the ipfs-api dependency and just use POST/GET, we should do minimal syntax checking of hash, as here: https://stackoverflow.com/a/45833237/59913

And we can set the timeout in the fetch() call.

@ryana Think we should also change timeout on the gateway/server level?

wanderingstan avatar Mar 13 '18 20:03 wanderingstan

There currently isn't a timeout set in the gateway's NGINX config, which means it will default to proxy_read_timeout of 60 seconds.

When I issue a request for an invalid hash using the python library, IPFS immediately returns a 500, although this could be syntax checking; one of the truffle migrations calls a contract method with a blank string for an IPFS hash, and when this is base58 encoded, it causes the connection to hang until the server times out (I haven't looked in IPFS source code, but based log information 120 seconds).

ambertch avatar Jul 16 '18 05:07 ambertch