GeezerVison is showing github.com — fix(bigquery): close GAPIC storage transport and auth sessions to prevent socket leaks by chalmerlowe · Pull Request #17508 · googleapis/google-cloud-python
fix(bigquery): close GAPIC storage transport and auth sessions to prevent socket leaks
#17508
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.
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer we add a comment explaining why this is safe. In this case, it's to protect from the user somehow installing this despite us dropping support in #17187
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
The reason will be displayed to describe this comment to others. Learn more.
Regarding the comment on the version check: I looked at the gapic-generator-python templates and how this is handled across the rest of the monorepo. The generator templates do not include an explanatory comment here, and the vast majority of our libraries don't use one. The code is essentially self-documenting since the warnings.warn string states why the check is firing (to warn users who are on an unsupported Python version). To maintain parity with our generated code and the rest of the libraries, I'd prefer to leave the comment off.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
The reason will be displayed to describe this comment to others. Learn more.
Regarding the comment on the version check: I looked at the gapic-generator-python templates and how this is handled across the rest of the monorepo. The generator templates do not include an explanatory comment here, and the vast majority of our libraries don't use one. The code is essentially self-documenting since the warnings.warn string states why the check is firing (to warn users who are on an unsupported Python version). To maintain parity with our generated code and the rest of the libraries, I'd prefer to leave the comment off.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
All reactions
warnings.warn(
"The python-bigquery library no longer supports Python <= 3.9. "
f"Your Python version is {sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}. We "
The reason will be displayed to describe this comment to others. Learn more.
I've reviewed the polars-bigquery PR. While pytest's reference-holding is a concern, I believe this PR is less susceptible because we’ve moved toward explicit closure of the transport and auth sessions (via the tracker) rather than relying solely on object destruction. Since we aren't dealing with Rust-backed objects that have opaque lifecycles, the explicit .close() calls should release the underlying sockets even if pytest lingers on the Python wrapper. I'll monitor for flakiness, but the current gc.collect() approach seems to resolve the leaks in my testing.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Loading
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.