Skip to content

fix: close BigQuery client in fileIterator.Close to prevent connection leak#9706

Merged
k-anshul merged 1 commit into
mainfrom
nishant/fix-bigquery-client-leak
Jul 20, 2026
Merged

fix: close BigQuery client in fileIterator.Close to prevent connection leak#9706
k-anshul merged 1 commit into
mainfrom
nishant/fix-bigquery-client-leak

Conversation

@nishantmonu51

Copy link
Copy Markdown
Collaborator
  • QueryAsFiles opens a *bigquery.Client (with a Storage Read gRPC client) and hands it to the returned fileIterator, but the iterator's Close() only removed the temp dir; the client was closed only on error paths, so every successful ingest leaked the client and its gRPC connections/goroutines.
  • Close the client in fileIterator.Close(), matching how the Snowflake and Databricks iterators release their connections.

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

@nishantmonu51
nishantmonu51 requested a review from k-anshul July 19, 2026 10:25
@nishantmonu51

Copy link
Copy Markdown
Collaborator Author

@codex: review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 198f317222

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@k-anshul
k-anshul merged commit 6e16157 into main Jul 20, 2026
16 checks passed
@k-anshul
k-anshul deleted the nishant/fix-bigquery-client-leak branch July 20, 2026 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants