Improve performance of servePretty404IfPresent in absence of a pretty 404 #9067
Labels
kind/enhancement
A net-new feature or improvement to an existing feature
topic/gateway
Topic gateway
Checklist
Description
The function servePretty404IfPresent recurses a UnixFS looking for a file named
ipfs-404.html
at each level.When the file does not exist, the function walks up the DAG looking for the file at each level. The default timeout (from go-path) is 1 minute for each traversal.
As an example, fetching the following request failed after 5m since it failed to fetch QmZFP53gibtpCjJAMmhAf7ugPS8hvhQiZ8b8ttMkhdqWGY/1/6/6/1661/1661-h.zip
after 1m and then spent a further 1m for each of:
All failed trying to get block QmSpnerMwvUS4ZxZGw2Dx66E63amgYAKgehxnAP8rc7fLE. But the following failed fast because (presumably) the relevant blocks were present in the local blockstore:
servePretty404IfPresent
should remember that a block was unreachable and not include that in the recursion and should set an overall timeout for the entire traversal, not for each lookup.The text was updated successfully, but these errors were encountered: