-
Notifications
You must be signed in to change notification settings - Fork 123
Refactor provider shutdown and pending flows #240
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,7 +64,7 @@ extension HTTP1ConnectionProvider { | |
private var openedConnectionsCount: Int = 0 | ||
|
||
/// Number of enqueued requests, used to track if it is safe to delete the provider. | ||
private var pending: Int = 1 | ||
private var pending: Int = 0 | ||
|
||
init(maximumConcurrentConnections: Int = 8, eventLoop: EventLoop) { | ||
self.maximumConcurrentConnections = maximumConcurrentConnections | ||
|
@@ -148,7 +148,7 @@ extension HTTP1ConnectionProvider { | |
return .none | ||
} | ||
case .closed: | ||
return .fail(waiter, ProviderClosedError()) | ||
return .fail(waiter, HTTPClientError.alreadyShutdown) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @artemredkin from what I can tell, no test noticed that this error changed which probably means no test is getting this error ;). I think we should probably add a test case that tests this condition. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. filed #244 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Specific test is a good idea, yes, though this error was picked up by a test, just not reliably :) |
||
} | ||
} | ||
|
||
|
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.
nice! I left a bunch of stuff like the following comments in the code
and
I believe we can also delete all this code then.
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 was able to delete the workaround, some clean up code, and I was able to replace some cleanup with API calls instead of direct state manipulation. Currently there are 3-4 tests that manipulate state directly (they all need the state to be near the limit), do you want me to fix it here or when I get to #232?
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.
no, let's fix them in a followup. It's super awesome you could remove the workaround