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 for each request in forwardAuth middleware #6267

Merged
merged 2 commits into from Feb 3, 2020

Conversation

juliens
Copy link
Member

@juliens juliens commented Feb 3, 2020

What does this PR do?

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

@traefiker traefiker added this to the 2.1 milestone Feb 3, 2020
@juliens juliens changed the title don't create http client in each request don't create http client for each request in forwardAuth middleware Feb 3, 2020
Copy link
Member

@jbdoumenjou jbdoumenjou left a comment

Choose a reason for hiding this comment

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

LGTM

@ldez ldez added this to To review in v2 via automation Feb 3, 2020
Copy link
Member

@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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
v2
Done
Development

Successfully merging this pull request may close these issues.

None yet

5 participants