Skip to content
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

don't create http client in each request in forward auth #6273

Merged
merged 2 commits into from
Feb 4, 2020

Conversation

juliens
Copy link
Member

@juliens juliens commented Feb 4, 2020

What does this PR do?

Same as #6267 but for v1.7

This PR changes the way to create the http client in the forward auth middleware.
Before this modification, the http client was created for each request. When it was done without configuring tls, it was not a big problem, because we reused the http.DefaultTransport but when tls was activated, the http.Transport was created in each request, and that automatically creates a new connection to the forward auth server, and since we have not configured an expiration time on the idle connection on these transports, we have kept the connections open forever.

Motivation

Fixes #6229

Copy link
Contributor

@ldez ldez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@dtomcej dtomcej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
:shipit:

middlewares/auth/forward.go Outdated Show resolved Hide resolved
Co-Authored-By: mpl <mathieu.lonjaret@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants