-
Notifications
You must be signed in to change notification settings - Fork 122
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.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SNOW-782588: Retry result request for async query if still in progress #824
Merged
+73
−17
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sfc-gh-ext-simba-lb
force-pushed
the
fixLongRunningAsyncQueryIssue
branch
from
June 15, 2023 17:03
e9d22bc
to
c189aab
Compare
sfc-gh-pfus
reviewed
Jun 16, 2023
sfc-gh-ext-simba-lb
force-pushed
the
fixLongRunningAsyncQueryIssue
branch
2 times, most recently
from
June 16, 2023 19:21
1e3c97d
to
5ddeff0
Compare
sfc-gh-pfus
approved these changes
Jun 19, 2023
update comment
sfc-gh-ext-simba-lb
force-pushed
the
fixLongRunningAsyncQueryIssue
branch
from
June 22, 2023 21:45
0473aa6
to
aa0d6f2
Compare
sfc-gh-igarish
approved these changes
Jun 22, 2023
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.
LGTM
sfc-gh-igarish
added
bug
Erroneous or unexpected behaviour
and removed
bug
Erroneous or unexpected behaviour
labels
Jun 23, 2023
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
For #768 and #795
https://github.com/snowflakedb/snowflake-sdks-drivers-issues-teamwork/issues/323
If a statement is executed and the execution is completed in 45 seconds, the server returns the result. If the statement execution takes longer to complete, the statement handle is returned.
In the current driver implementation, when making a get request to the
/queries/<query-id>/result
endpoint, the response will be processed even if the server returns the queryInProgressAsyncCode (333334). Since it doesn't check the response code for in progress queries, it will be marked as complete even though the query hasn't finished and the result was not returned.This change is to retry the request to the /result endpoint if the query is still in progress so that results are retrieved for queries longer than 45 seconds. Adding a backoff up to 5 seconds similar to the pattern from the jdbc driver: https://github.com/snowflakedb/snowflake-jdbc/blob/master/src/main/java/net/snowflake/client/jdbc/SFAsyncResultSet.java#L125
Checklist
make fmt
to fix inconsistent formatsmake lint
to get lint errors and fix all of them