-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
journal client: re-create http client after receiving internal errors
This addresses an issue we've encountered in production that results in a large number of request failures. This happens when one of the TCP connections is to a server that starts sending RSTStream frames with an `INTERNAL_ERROR` status (http2 stream status, not http request status). In this case, the Go http client will continue to re-use the connection for other requests, which also fail in the same way. What we'd really like is to have some sort of logic that says, "if connection x has returned such an internal error, then stop using that connection for future requests and shut it down". Unfortunately, such logic is impossible to express with the current `Transport` and `ClientConnPool` APIs. So the next best thing is a workaround where we re-create the entire http client, to force it to re-establish all connections. That's what this does. Plus a little extra for dealing with the dynamic enablement/disablement of the file protocol transport.
- Loading branch information
Showing
1 changed file
with
91 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters