-
Notifications
You must be signed in to change notification settings - Fork 27
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
Draft: UUID regeneration on retry #26
base: main
Are you sure you want to change the base?
Conversation
@andrusha @dmzmk this is ready for review (no rush), I had to make some |
The docs are for the json api, which is different from odbc api this lib implements, looking at the https://github.com/snowflakedb/gosnowflake/blob/2f775957a87540a93078051bc132991777ec715a/retry.go#L49 they do pass a similar parameter however, but it's |
This MR attempts to fix a bug where UUIDs are not properly regenerated on retries triggered by middleware. By moving request parameters for UUID and Timestamp generation into middleware, we fix that, but also allow future enhancements for more robust error handling modes like what is specified in: https://docs.snowflake.com/en/developer-guide/sql-api/submitting-requests#resubmitting-a-request-to-execute-sql-statements.
I still need to figure out a good solution for testing this, might end up mocking one of the endpoints.
We should be able to leverage Extension state to detect if a request is a retry, and based on the user's client configuration hint snowflake that it should "rescan" to see if the query was successful or not.