filecoin-saturn / caboose

A blockstore for distributing load
Other
12 stars 2 forks source link

Cool-down amplification of non-existant CIDs #44

Closed willscott closed 1 year ago

willscott commented 1 year ago

if a CID fails multiple times across the pool, add it to a cooldown bucket and return some error that bifrost-gateway could turn into 429 (Too Many Requests) response with Retry-After header matching the cooldown duration.

lidel commented 1 year ago

If Caboose returns ErrSaturnRetryAfter with RetryAfter as error attribute, we will be able to bubble it up to go-libipfs/gateway like we do existing timeouts:

https://github.com/ipfs/bifrost-gateway/blob/c305b3ba95dc13b06392975ab2bbb9b475e319a7/blockstore.go#L70-L87

And then return correct HTTP 429 with Retry-After header.

I've filed https://github.com/ipfs/go-libipfs/issues/188 which is how we wire this up in a way that is useful beyond Saturn and Caboose.

aarshkshah1992 commented 1 year ago

This landed in https://github.com/filecoin-saturn/caboose/pull/59.