Support context cancellation in Gateway directory listings #9066
Labels
kind/enhancement
A net-new feature or improvement to an existing feature
P2
Medium: Good to have, but can wait until someone steps up
topic/gateway
Topic gateway
Milestone
Checklist
Description
This is a low priority general enhancement to conserve resources when dealing with slow clients. Directory listings may be very large and take a long time to transfer and we should respect cancellation of the request context (due to timeout or explicit).
As of commit 862ce6b, directory listings iterate over an
Ls
of a UnixFS and do not check for context cancellation:https://github.com/ipfs/go-ipfs/blob/862ce6bb8f6ce24b91ed3dc59e7406faed34f583/core/corehttp/gateway_handler_unixfs_dir.go#L117
The request context is available and could simply be checked during iteration
The text was updated successfully, but these errors were encountered: