Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit 977ae4a

Browse files
authored
Merge pull request #41522 from thaJeztah/19.03_backport_gcp_leak
[19.03 backport] Fix gcplogs memory/connection leak Upstream-commit: 233a6379e5c07588d8eb3be3b7a57dc916336b0b Component: engine
2 parents 3a9689e + 4afdfee commit 977ae4a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

components/engine/daemon/logger/gcplogs/gcplogging.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ func init() {
5353
}
5454

5555
type gcplogs struct {
56+
client *logging.Client
5657
logger *logging.Logger
5758
instance *instanceInfo
5859
container *containerInfo
@@ -169,6 +170,7 @@ func New(info logger.Info) (logger.Logger, error) {
169170
}
170171

171172
l := &gcplogs{
173+
client: c,
172174
logger: lg,
173175
container: &containerInfo{
174176
Name: info.ContainerName,
@@ -236,7 +238,7 @@ func (l *gcplogs) Log(m *logger.Message) error {
236238

237239
func (l *gcplogs) Close() error {
238240
l.logger.Flush()
239-
return nil
241+
return l.client.Close()
240242
}
241243

242244
func (l *gcplogs) Name() string {

0 commit comments

Comments
 (0)