-
Notifications
You must be signed in to change notification settings - Fork 179
Snow 1915351 network problems retrying2 #2153
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
base: master
Are you sure you want to change the base?
Conversation
24000c9
to
b1fd8aa
Compare
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
ede6e57
to
e139120
Compare
ec3de52
to
5c86146
Compare
// when there are transient network/GS issues | ||
private long startTimePerRequest; | ||
// Used to indicate that this is a login/auth request and will be using the new retry strategy. | ||
boolean isLoginRequest; |
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.
why not make this private (perhaps even final), when we have public getters/setters?
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.
Fixed, final, not because we have a setter.
} | ||
|
||
static long getNewBackoffInMilli( | ||
public static long getNewBackoffInMilli( |
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.
Do we want to expose this to the public? Without @SnowflakeJdbcInternalApi
?
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.
Fixed
* @throws net.snowflake.client.jdbc.SnowflakeSQLException Request timeout Exception or Illegal | ||
* State Exception i.e. connection is already shutdown etc | ||
*/ | ||
public static HttpResponseContextDto executeWitRetries( |
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.
internal api annotation?
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.
Fixed
@@ -318,6 +318,10 @@ public static Connection getConnection( | |||
properties.put("warehouse", params.get("warehouse")); | |||
properties.put("ssl", params.get("ssl")); | |||
|
|||
// properties.put("useProxy", "true"); |
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.
to remove
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.
Fixed
importMappingFromResources(SCENARIOS_BASE_DIR + "/response503.json"); | ||
Properties props = new Properties(); | ||
props.setProperty("maxHttpRetries", "3"); | ||
// WireMock.setScenarioState("malformed_response_retry", "MALFORMED_RETRY_3"); |
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.
remove
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.
Fixed
|
||
// max backoff in milli before we retry due to transient issues | ||
// we double the backoff after each retry till we reach the max backoff | ||
// private static final long maxBackoff= 16000; |
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.
Leftover?
@SnowflakeJdbcInternalApi | ||
public class HttpExecutingContext { | ||
|
||
// min backoff in milli before we retry due to transient issues |
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.
In the other parts of the code you used ...Milliseconds suffix for values in milliseconds. Names without it meant values in seconds. Should we use such convention here as well and maybe include such explanation somewhere in comments?
338f1ae
to
b979ef1
Compare
b979ef1
to
8dd554c
Compare
Overview
SNOW-XXXXX
Pre-review self checklist
master
branchmvn -P check-style validate
)mvn verify
and inspecttarget/japicmp/japicmp.html
)SNOW-XXXX:
External contributors - please answer these questions before submitting a pull request. Thanks!
What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Issue: #NNNN
Fill out the following pre-review checklist:
@SnowflakeJdbcInternalApi
(note that public/protected methods/fields in classes marked with this annotation are already internal)Please describe how your code solves the related issue.
Please write a short description of how your code change solves the related issue.