Skip to content

feat(bigquery): add timeout parameter to QueryJob.done() method - #9875

Merged
plamut merged 6 commits into
googleapis:masterfrom
plamut:iss-7831
Dec 19, 2019
Merged

feat(bigquery): add timeout parameter to QueryJob.done() method#9875
plamut merged 6 commits into
googleapis:masterfrom
plamut:iss-7831

Conversation

@plamut

@plamutplamut commented Nov 21, 2019

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

@plamutplamut 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 tswastNovember 21, 2019 15:01
@googlebotgooglebot added the cla: yes This human has signed the Contributor License Agreement. label Nov 21, 2019
Comment threadbigquery/google/cloud/bigquery/client.py Outdated
Comment threadbigquery/google/cloud/bigquery/retry.py Outdated
@plamut

Copy link
Copy Markdown
ContributorAuthor

@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.

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

Copy link
Copy Markdown
ContributorAuthor

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

In addition, fix the timeout logic in QueryJob.done() - the timeouts
are in different units (seconds vs. milliseconds)
The new timeout feature requires more recent versions of the API core
and google auth dependencies.
@plamut
plamut marked this pull request as ready for review December 17, 2019 11:05
@plamut
plamut requested review from a team and tswastDecember 17, 2019 11:05
Comment threadbigquery/google/cloud/bigquery/job.py Outdated
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 tswastDecember 18, 2019 23:45

@tswasttswast left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

4 participants

@plamut@tswast@googlebot@yoshi-kokoro