Skip to content

[ConnectionPool] Fix race between shutdown and backoff timer #419

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

Merged

Conversation

fabianfett
Copy link
Member

@fabianfett fabianfett commented Sep 9, 2021

Apparently I introduced a flaky test that showed up here:
https://ci.swiftserver.group/job/async-http-client-swift53-prb/403/console

Test Case 'HTTPConnectionPoolTests.testConnectionCreationIsRetriedUntilPoolIsShutdown' started at 2021-09-09 13:48:55.778
Assertion failed: At least this connection is currently in backoff: file AsyncHTTPClient/HTTPConnectionPool+HTTP1StateMachine.swift, line 171
Current stack trace:
0    libswiftCore.so                    0x00007f99eae1d990 swift_reportError + 50
1    libswiftCore.so                    0x00007f99eae91260 _swift_stdlib_reportFatalErrorInFile + 115
2    libswiftCore.so                    0x00007f99eab76925 <unavailable> + 1399077
3    libswiftCore.so                    0x00007f99eab76567 <unavailable> + 1398119
4    libswiftCore.so                    0x00007f99eab76b02 <unavailable> + 1399554
5    libswiftCore.so                    0x00007f99eab74fa0 _assertionFailure(_:_:file:line:flags:) + 517
6    async-http-clientPackageTests.xctest 0x0000562a0c50e4b3 <unavailable> + 1422515
7    async-http-clientPackageTests.xctest 0x0000562a0c518156 <unavailable> + 1462614
8    async-http-clientPackageTests.xctest 0x0000562a0c4deac4 <unavailable> + 1227460
9    async-http-clientPackageTests.xctest 0x0000562a0c4e5b61 <unavailable> + 1256289
10   async-http-clientPackageTests.xctest 0x0000562a0c4da7aa <unavailable> + 1210282
11   async-http-clientPackageTests.xctest 0x0000562a0c4e5b84 <unavailable> + 1256324
12   async-http-clientPackageTests.xctest 0x0000562a0caa9b24 <unavailable> + 7301924
13   async-http-clientPackageTests.xctest 0x0000562a0c4de80b <unavailable> + 1226763
14   async-http-clientPackageTests.xctest 0x0000562a0c48ec1f <unavailable> + 900127
15   async-http-clientPackageTests.xctest 0x0000562a0c4e5ac4 <unavailable> + 1256132
16   async-http-clientPackageTests.xctest 0x0000562a0ce3e759 <unavailable> + 11056985
17   async-http-clientPackageTests.xctest 0x0000562a0cbf263c <unavailable> + 8648252
18   async-http-clientPackageTests.xctest 0x0000562a0ce46921 <unavailable> + 11090209
19   async-http-clientPackageTests.xctest 0x0000562a0cbefc4c <unavailable> + 8637516
20   async-http-clientPackageTests.xctest 0x0000562a0ce41ef7 <unavailable> + 11071223
21   async-http-clientPackageTests.xctest 0x0000562a0c4de0df <unavailable> + 1224927
22   async-http-clientPackageTests.xctest 0x0000562a0ce45164 <unavailable> + 11084132
23   async-http-clientPackageTests.xctest 0x0000562a0ce3b052 <unavailable> + 11042898
24   async-http-clientPackageTests.xctest 0x0000562a0ce401cc <unavailable> + 11063756
25   async-http-clientPackageTests.xctest 0x0000562a0ce0251b <unavailable> + 10810651
26   async-http-clientPackageTests.xctest 0x0000562a0ce02cdf <unavailable> + 10812639
27   async-http-clientPackageTests.xctest 0x0000562a0ce088e3 <unavailable> + 10836195
28   async-http-clientPackageTests.xctest 0x0000562a0ce00fdf <unavailable> + 10805215
29   async-http-clientPackageTests.xctest 0x0000562a0ce86e51 <unavailable> + 11353681
30   async-http-clientPackageTests.xctest 0x0000562a0ce8a3de <unavailable> + 11367390
31   async-http-clientPackageTests.xctest 0x0000562a0ce8a589 <unavailable> + 11367817
32   libpthread.so.0                    0x00007f99ea8096db <unavailable> + 30427
33   libc.so.6                          0x00007f99e89926e0 clone + 63
Exited with signal code 4

This pr fixes this assertion.

@fabianfett fabianfett requested a review from glbrntt September 9, 2021 14:25
@fabianfett fabianfett force-pushed the ff-fix-backoff-vs-shutdown-race branch from 480e809 to 4a86322 Compare September 9, 2021 14:27
@fabianfett fabianfett added this to the HTTP/2 support milestone Sep 9, 2021
@fabianfett fabianfett merged commit 7bb58e5 into swift-server:main Sep 9, 2021
@fabianfett fabianfett deleted the ff-fix-backoff-vs-shutdown-race branch September 9, 2021 15:01
@fabianfett fabianfett added the 🔨 semver/patch No public API change. label Sep 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants