-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Fix gcplogs memory/connection leak #41513
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
Conversation
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.
LGTM, thanks!
Actually, this doesn't compile;
|
Ack. I'm figuring out the build/test process right now (first time working on this project). This method should exist according to the docs, though our vendored version may be behind. |
I recalled I had a PR that updates the dependencies to a more recent version (may have to do a follow-up after that, because it stalled some time, so is now quite behind on current latest); I just rebased it to see if the CI issues on that one are resolved; #39838 |
Should be working now (got my local environment setup and verified the fix) I had mixed up the internals (gcplogs creates a NewClient and then a Logger, discarding the former, while that's the object that requires closing) |
Thanks! Could you perhaps squash the two commits? |
The cloud logging client should be closed when the log driver is closed. Otherwise dockerd will keep a gRPC connection to the logging endpoint open indefinitely. This results in a slow leak of tcp sockets (1) and memory (~200Kb) any time that a container using `--log-driver=gcplogs` is terminates. Signed-off-by: Patrick Haas <patrickhaas@google.com>
Gladly. Squashed (and force pushed), hope everything looks ok still :) |
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.
LGTM if green 👍
@cpuguy83 ptal |
The cloud logging client should be closed when the log driver is closed. Otherwise dockerd will keep a gRPC connection to the logging endpoint open indefinitely.
This results in a slow leak of tcp sockets (1) and memory (~200Kb) any time that a container using
--log-driver=gcplogs
is terminates.fixes #41512
Testing
Tested locally in docker dev environment,
docker run --rm --log-driver=gcplogs hello-world
no longer grows the connection count of dockerd.- Description for the changelog Fix gcplogs memory/connection leak