Closed thepwagner closed 2 years ago
_lynnsh noted from https://pkg.go.dev/cloud.google.com/go/containeranalysis/apiv1#Client.GetGrafeasClient
Calling Close on either the grafeas or containeranalysis client will close the shared connection in both.
I think that comment is out of date, opened https://github.com/googleapis/google-cloud-go/issues/5217 to confirm or deny this.
This is behaving great in our test environment, :shipit: and closing #20
In
containeranalysis.NewClient()
, we allocate a containeranalysis client, but only use the.GetGrafeasClient()
member.This results in leaking the containeranalysis client's connection pool, whenever a new client is created.
Longer term, we should look at reusing connections as an alternative solution to this leak: there are other performance advantages.
Co-Authored-By: Brian Chen brian.chen@shopify.com Co-Authored-By: Aline Shulzhenko lynnsh@users.noreply.github.com
Related