Skip to content

Support context cancellation in Gateway directory listings #9066

Open
@iand

Description

@iand

Checklist

  • My issue is specific & actionable.
  • I am not suggesting a protocol enhancement.
  • I have searched on the issue tracker for my issue.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium: Good to have, but can wait until someone steps upkind/enhancementA net-new feature or improvement to an existing featuretopic/gatewayTopic gateway

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions