Skip to content

HTTP1ConnectionsProvider shutdown isn't quite sound #232

Closed
@weissi

Description

@weissi

This test:

        XCTAssertNoThrow(try HTTP1ConnectionProvider(key: .init(.init(url: "http://some.test")),
                                                     eventLoop: self.eventLoop,
                                                     configuration: .init(),
                                                     pool: .init(configuration: .init(),
                                                                 backgroundActivityLogger: HTTPClient.loggingDisabled),
                                                     backgroundActivityLogger: HTTPClient.loggingDisabled)
                            .close().wait())

hangs forever (because there's 1 pending connection) which isn't right.

The connection provider (is probably wrongly) expecting that acquire will come along and decrease pending. I'd argue it a) shouldn't wait for acquire to come along b) acquire cannot actually do that right now because acquire only decreases pending IF we're .active.

That's a real race that can happen in real usage I believe.

Metadata

Metadata

Assignees

Labels

kind/bugFeature doesn't work as expected.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions