Skip to content

HTTP1ConnectionsProvider shutdown isn't quite sound #232

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
weissi opened this issue May 29, 2020 · 0 comments · Fixed by #240
Closed

HTTP1ConnectionsProvider shutdown isn't quite sound #232

weissi opened this issue May 29, 2020 · 0 comments · Fixed by #240
Assignees
Labels
kind/bug Feature doesn't work as expected.
Milestone

Comments

@weissi
Copy link
Contributor

weissi commented May 29, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Feature doesn't work as expected.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants