GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(bigquery): add timeout parameter to QueryJob.done() method by plamut · Pull Request #9875 · googleapis/google-cloud-python

Conversation

@plamut

@plamut plamut commented Nov 21, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Fixes #7831.
Requires #9873.

This is a proposed fix for the done() method getting stuck. It makes sure that the underlying HTTP request does not block indefinitely when retrieving query results, and that any underlying requests exceptions are retriable.

TODO

  • Add missing / adjust existing tests.
  • Change the behavior of core.Retry to raise a timeout error at (approximately) the retry deadline, and not potentially much later that it. (feat(api_core): make the last retry happen at deadline #9873)
  • Add timeout parameter to _http.JSONConnection.api_request() (feat(core): add timeout param to JSONConnection.api_request() #9915)
  • Add timeout parameter to google.auth.transport.AuthorizedSession.request() that BigQuery client uses as its transport (feat: add timeout parameter to AuthorizedSession.request() google-auth-library-python#406)
  • Update BigQuery's setup.py to depend on the new api_core version, and the new auth library version (once the timeout-related changes are merged, and the new versions of those libraries released).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@plamut plamut added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. api: bigquery Issues related to the BigQuery API. labels Nov 21, 2019
@plamut
plamut requested a review from tswast November 21, 2019 15:01
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Nov 21, 2019
tswast
tswast reviewed Nov 27, 2019
View reviewed changes
Comment thread bigquery/google/cloud/bigquery/client.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread bigquery/google/cloud/bigquery/retry.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Dec 4, 2019
feat(core): add timeout param to JSONConnection.api_request() #9915
Merged
Add timeout parameter to AuthorizedSession.request() googleapis/google-auth-library-python#396
Closed
@plamut
plamut force-pushed the iss-7831 branch from e19ba16 to 2f37317 Compare December 9, 2019 16:16
@plamut

plamut commented Dec 9, 2019

Copy link
Copy Markdown
Contributor Author

@tswast Ditched the custom HTTP adapter, and leveraged the new connection timeout parameter from #9915. The changes are now minimal, and can be easily applied to other client methods that would benefit from a timeout.

tswast reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@plamut
plamut force-pushed the iss-7831 branch 6 times, most recently from 87d74f7 to 2044a84 Compare December 11, 2019 07:48
@plamut plamut added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 11, 2019
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 11, 2019
@plamut

plamut commented Dec 11, 2019

Copy link
Copy Markdown
Contributor Author

A snippets test failed, seems like flakiness (it passed on several previous runs). Re-running.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Dec 11, 2019
fix(bigquery): fix copy pasta error in import error message (pandas -> pyarrow) #9955
Merged
chore(bigquery): release 1.23.0 #9961
Merged
plamut added 5 commits December 17, 2019 11:01
@plamut
feat(bigquery): add timeout to QueryJob.done()
3801d2d
@plamut
Add tests for methods that got timeout param
e75b30e
In addition, fix the timeout logic in QueryJob.done() - the timeouts
are in different units (seconds vs. milliseconds)
@plamut
Fix lint warning (unused variable)
28964f2
@plamut
Adjust timeout exception type in QueryJob.result()
fb95ca5
@plamut
Update dependency pins
38f0f38
The new timeout feature requires more recent versions of the API core
and google auth dependencies.
@plamut
plamut force-pushed the iss-7831 branch from 2044a84 to 38f0f38 Compare December 17, 2019 11:05
@plamut
plamut marked this pull request as ready for review December 17, 2019 11:05
@plamut
plamut requested review from a team and tswast December 17, 2019 11:05
tswast
tswast requested changes Dec 18, 2019
View reviewed changes
Comment thread bigquery/google/cloud/bigquery/job.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@plamut
Add safety margin on top of server-side timeout
fe218df
If the server-side processing timeout is used (the `timeout_ms` API
parameter) as the total timeout, it should be slightly longer than
the actual server-side timeout in order to not timeout the connection
while there might still be chance that the server-side processing
has actually completed.
@plamut
plamut requested a review from tswast December 18, 2019 23:45
tswast
tswast approved these changes Dec 19, 2019
View reviewed changes

@tswast tswast left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@plamut
plamut merged commit 13bd849 into googleapis:master Dec 19, 2019
@plamut
plamut deleted the iss-7831 branch December 19, 2019 01:45
This was referenced Jan 29, 2020
chore(bigquery): bump copyright year to 2020, tweak docstring formatting (via synth) #10225
Merged
docs(language): change docstring formatting; bump copyright year to 2020 (via synth) #10234
Merged
[CHANGE ME] Re-generated container to pick up changes in the API or client library generator. #10256
Closed
[CHANGE ME] Re-generated datastore to pick up changes in the API or client library generator. #10261
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@tswast tswast tswast approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

api: bigquery Issues related to the BigQuery API. cla: yes This human has signed the Contributor License Agreement. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

BigQuery: QueryJob().done() method gets stuck

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@plamut @tswast @googlebot @yoshi-kokoro
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.