Skip to content

[27.x backport] client: prevent idle connections leaking FDs#48764

Merged
thaJeztah merged 1 commit intomoby:27.xfrom
laurazard:27.x-backport-idle-conns
Oct 25, 2024
Merged

[27.x backport] client: prevent idle connections leaking FDs#48764
thaJeztah merged 1 commit intomoby:27.xfrom
laurazard:27.x-backport-idle-conns

Conversation

@laurazard
Copy link
Copy Markdown
Member

@laurazard laurazard commented Oct 25, 2024

Patch from tonistiigi@af6ada9

- What I did

Without this change, if a long-lived process is using the client, idle connections are not released and grow over time.

We can also look into addressing this issue from the server side, but it doesn't hurt for the client package to have good defaults and not cause this.

- How I did it

Set MaxIdleConns and IdleConnTimeout on the defaultHTTPClient.

- How to verify it

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

Patch from tonistiigi@af6ada9

Without this change, if a long-lived process uses the client and creates
connections, these connections are not released and grow over time.

We can also look into addressing this issue from the server side, but it
doesn't hurt for the `client` package to have good defaults and not
cause this.

Signed-off-by: Laura Brehm <[email protected]>
(cherry picked from commit 5c72a95)
Signed-off-by: Laura Brehm <[email protected]>
@laurazard laurazard added this to the 27.4.0 milestone Oct 25, 2024
@laurazard laurazard self-assigned this Oct 25, 2024
@laurazard laurazard added the kind/bugfix PR's that fix bugs label Oct 25, 2024
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@thaJeztah thaJeztah merged commit 5c383ad into moby:27.x Oct 25, 2024
@thaJeztah thaJeztah linked an issue Oct 25, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

client idle connections leak FDs against Docker Desktop

2 participants