-
Notifications
You must be signed in to change notification settings - Fork 123
[HTTPClient.Configuration] Make connection pool size configurable #437
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
[HTTPClient.Configuration] Make connection pool size configurable #437
Conversation
e318759
to
41b5b16
Compare
} | ||
} | ||
} | ||
let timeout = DispatchTime.now() + .seconds(180) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This timeout is really long for CI. Can we lower it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid we will need to change the number of requests and threads to something smaller, if we change the timeout to 60 seconds :)
Test Case 'HTTPClientTests.testConnectionPoolSizeConfigValueIsRespected' started at 2021-09-24 13:48:02.845
/code/Tests/AsyncHTTPClientTests/HTTPClientTests.swift:3101: error: HTTPClientTests.testConnectionPoolSizeConfigValueIsRespected : failed - Timed out
/code/Tests/AsyncHTTPClientTests/HTTPClientTests.swift:3089: error: HTTPClientTests.testConnectionPoolSizeConfigValueIsRespected : XCTAssertNoThrow failed: threw error "HTTPClientError.cancelled" -
/code/Tests/AsyncHTTPClientTests/HTTPClientTests.swift:3089: error: HTTPClientTests.testConnectionPoolSizeConfigValueIsRespected : XCTAssertNoThrow failed: threw error "HTTPClientError.alreadyShutdown" -
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reduced the amount of requests.
self.init(idleTimeout: idleTimeout, concurrentHTTP1ConnectionsPerHostSoftLimit: 8) | ||
} | ||
|
||
public init(idleTimeout: TimeAmount = .seconds(60), concurrentHTTP1ConnectionsPerHostSoftLimit: Int = 8) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should avoid a new defaulted parameter here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can just remove the default value and get the "behaviour" of a default value because we have the init above which only takes idleTimeout
as a parameter.
fa60917
to
149fdca
Compare
Failing |
149fdca
to
0334abf
Compare
0334abf
to
58013d9
Compare
Fixes #373