Skip to content

fix FileDownloadDelegate #364

Closed
Closed
@weissi

Description

@weissi

FileDownloadDelegate calls pool.start() on a NIOThreadPool that is either provided by the user or by AHC itself through

public init(
        path: String,
        pool: NIOThreadPool = NIOThreadPool(numberOfThreads: 1),
        reportHead: ((HTTPResponseHead) -> Void)? = nil,
        reportProgress: ((Progress) -> Void)? = nil
    )

AHC however never calls .shutdownGracefully/.syncShutdownGracefully on that pool. That means the user has to provide a NIOThreadPool, or else we'll just leak it (because AHC never calls stop).

Ie. in the default use case we

  • spawn a fresh thread per download
  • and then leak the thread

😭

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugFeature doesn't work as expected.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions