This repository has been archived by the owner on Jun 28, 2022. It is now read-only.
Create new instance of client info rather than stomping on shared instance. #2161
Labels
lang: python
Issues specific to Python.
priority: p1
Important issue which blocks shipping the next release. Will be fixed prior to next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
yoshi
While reviewing a new client @tseaver noticed a bit that may need revising.
Quoting from https://github.com/GoogleCloudPlatform/google-cloud-python/pull/5665/files/12676aaf08dc795f2216f9441896cfae54edd382#diff-198e257d2c267a0bc3e3d2f3e77ec561
https://github.com/GoogleCloudPlatform/google-cloud-python/blob/master/dlp/google/cloud/dlp_v2/gapic/dlp_service_client.py#L173
This bit is problematic -- the
DEFAULT_CLIENT_INFO
instance is going to be scribbled on by every library generated this way, which means that each time an app instantiates a generated client, they all use the last-instantiated one'sgapic_version
.Rather than reuse the instance, we should be constructing a new one here, e.g.:
The text was updated successfully, but these errors were encountered: