-
Notifications
You must be signed in to change notification settings - Fork 2
feat: switch to boxo and fix CAR fetch timeouts #68
Conversation
Context: ipfs/boxo#215 We use commit from ipfs/boxo#176 (comment) to unblock work on ipfs-inactive/bifrost-gateway#61
Context: ipfs/boxo#215 Used commits from ipfs/boxo#176 (comment) and filecoin-saturn/caboose#68 to unblock work on #61
Context: ipfs/boxo#215 Used commits from ipfs/boxo#176 (comment) and filecoin-saturn/caboose#68 to unblock work on #61
19s is not enough for fetching CAR stream of unknown length, every bigger request was failing. If we need to pick some ceiling, 30m sound like a good starting point (this is when CAR stream got timeouted on the old ipfs.io).
206d01a
to
5b37545
Compare
// TODO: Ideally, we would have additional "PerRequestInactivityTimeout" | ||
// which is the amount of time without any NEW data from the server, but | ||
// that can be added later. We need both because a slow trickle of data | ||
// could take a large amount of time. | ||
requestTimeout := DefaultSaturnCarRequestTimeout | ||
if isBlockRequest { | ||
requestTimeout = DefaultSaturnBlockRequestTimeout | ||
} | ||
|
||
reqCtx, cancel := context.WithTimeout(ctx, requestTimeout) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💭
Implementing "PerRequestInactivityTimeout" would help a lot – we could then have this 30m timeout as a hard ceiling (or even raise it), but then have the same timeout for block and for CAR when L1 did not send any new bytes for some time.
const DefaultSaturnBlockRequestTimeout = 19 * time.Second | ||
const DefaultSaturnCarRequestTimeout = 30 * time.Minute |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ Had to add separate timeout for CARs.
Not feeling strongly about 30m, but that is for how long I was able to stream wikipedia DAG from the old gateway, so a good starting point.
Undef cid was displayed as "b" (multibase prefix)
@@ -122,7 +130,16 @@ type ErrCoolDown struct { | |||
} | |||
|
|||
func (e *ErrCoolDown) Error() string { | |||
return fmt.Sprintf("multiple saturn retrieval failures seen for CID %s/Path %s, please retry after %s", e.Cid, e.Path, humanRetry(e.retryAfter)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ This was producing very confusing log errors failures seen for CID b/Path
due to e.Cid
being undefined, and printed not sanitized input from the user.
This PR switches to
boxo
(why: ipfs/boxo#215).It is possible we will be also adding things related to ipfs/boxo#176 and ipfs-inactive/bifrost-gateway#61 to this PR, so everything can be reviewed and merged together.
(Usually trying to have smaller PRs, but we have too many PRs caused by
boxo
rename, trying to minimize overhead related to this unplanned rename)TODO
go-libipfs
toboxo
(Context: Rename go-libipfs to boxo ipfs/boxo#215)TBD, could be follow-up PR