Skip to content

Commit 9acf849

Browse files
sfc-gh-dprzybyszsfc-gh-astachowskisfc-gh-dheymansfc-gh-rkowalski
authored
SNOW-1437655: Set auth timeout to 0 in not auth endpoint calls (#1770)
Co-authored-by: sfc-gh-astachowski <antoni.stachowski@snowflake.com> Co-authored-by: Dawid Heyman <dawid.heyman@snowflake.com> Co-authored-by: Rafal Kowalski <rafal.kowalski@snowflake.com>
1 parent c1bcbc5 commit 9acf849

File tree

7 files changed

+12
-14
lines changed

7 files changed

+12
-14
lines changed

src/main/java/net/snowflake/client/core/SFBaseSession.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,6 +1310,7 @@ public SFConnectionHandler getSfConnectionHandler() {
13101310
/**
13111311
* @return auth timeout in seconds
13121312
*/
1313+
@Deprecated
13131314
public abstract int getAuthTimeout();
13141315

13151316
/**

src/main/java/net/snowflake/client/core/SFSession.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public class SFSession extends SFBaseSession {
110110
*/
111111
private int networkTimeoutInMilli = 0; // in milliseconds
112112

113-
private int authTimeout = 0;
113+
@Deprecated private int authTimeout = 0;
114114
private boolean enableCombineDescribe = false;
115115
private Duration httpClientConnectionTimeout = HttpUtil.getConnectionTimeout();
116116
private Duration httpClientSocketTimeout = HttpUtil.getSocketTimeout();
@@ -232,7 +232,7 @@ private JsonNode getQueryMetadata(String queryID) throws SQLException {
232232
HttpUtil.executeGeneralRequest(
233233
get,
234234
loginTimeout,
235-
authTimeout,
235+
0,
236236
(int) httpClientSocketTimeout.toMillis(),
237237
maxHttpRetries,
238238
getHttpClientKey());
@@ -1139,7 +1139,7 @@ protected void heartbeat() throws SFException, SQLException {
11391139
HttpUtil.executeGeneralRequest(
11401140
postRequest,
11411141
SF_HEARTBEAT_TIMEOUT,
1142-
authTimeout,
1142+
0,
11431143
(int) httpClientSocketTimeout.toMillis(),
11441144
0,
11451145
getHttpClientKey());

src/main/java/net/snowflake/client/core/SessionUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,7 @@ static void closeSession(SFLoginInput loginInput) throws SFException, SnowflakeS
13941394
HttpUtil.executeGeneralRequest(
13951395
postRequest,
13961396
loginInput.getLoginTimeout(),
1397-
loginInput.getAuthTimeout(),
1397+
0,
13981398
loginInput.getSocketTimeoutInMillis(),
13991399
0,
14001400
loginInput.getHttpClientSettingsKey());

src/main/java/net/snowflake/client/core/StmtUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,8 @@ public static StmtOutput execute(StmtInput stmtInput, ExecTimeTelemetryData exec
380380
HttpUtil.executeRequest(
381381
httpRequest,
382382
stmtInput.networkTimeoutInMillis / 1000,
383-
stmtInput.socketTimeout,
384383
0,
384+
stmtInput.socketTimeout,
385385
stmtInput.maxRetries,
386386
stmtInput.injectSocketTimeout,
387387
stmtInput.canceling,
@@ -621,8 +621,8 @@ protected static String getQueryResult(String getResultPath, StmtInput stmtInput
621621
return HttpUtil.executeRequest(
622622
httpRequest,
623623
stmtInput.networkTimeoutInMillis / 1000,
624-
stmtInput.socketTimeout,
625624
0,
625+
stmtInput.socketTimeout,
626626
stmtInput.maxRetries,
627627
0,
628628
stmtInput.canceling,

src/main/java/net/snowflake/client/jdbc/DefaultResultStreamProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ else if (context.getQrmk() != null) {
136136
httpClient,
137137
httpRequest,
138138
context.getNetworkTimeoutInMilli() / 1000, // retry timeout
139-
context.getAuthTimeout(),
139+
0,
140140
context.getSocketTimeout(),
141141
0,
142142
0, // no socket timeout injection

src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeGCSClient.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ public void download(
240240
httpClient,
241241
httpRequest,
242242
session.getNetworkTimeoutInMilli() / 1000, // retry timeout
243-
session.getAuthTimeout(),
243+
0,
244244
session.getHttpClientSocketTimeout(),
245245
getMaxRetries(),
246246
0, // no socket timeout injection
@@ -426,7 +426,7 @@ public InputStream downloadToStream(
426426
httpClient,
427427
httpRequest,
428428
session.getNetworkTimeoutInMilli() / 1000, // retry timeout
429-
session.getAuthTimeout(),
429+
0,
430430
session.getHttpClientSocketTimeout(),
431431
getMaxRetries(),
432432
0, // no socket timeout injection
@@ -619,7 +619,6 @@ public void uploadWithPresignedUrlWithoutConnection(
619619

620620
uploadWithPresignedUrl(
621621
networkTimeoutInMilli,
622-
0, // auth timeout
623622
(int) HttpUtil.getSocketTimeout().toMillis(),
624623
meta.getContentEncoding(),
625624
meta.getUserMetadata(),
@@ -711,7 +710,6 @@ public void upload(
711710
logger.debug("Starting upload with downscope token", false);
712711
uploadWithPresignedUrl(
713712
session.getNetworkTimeoutInMilli(),
714-
session.getAuthTimeout(),
715713
session.getHttpClientSocketTimeout(),
716714
meta.getContentEncoding(),
717715
meta.getUserMetadata(),
@@ -882,7 +880,6 @@ private void uploadWithDownScopedToken(
882880
*/
883881
private void uploadWithPresignedUrl(
884882
int networkTimeoutInMilli,
885-
int authTimeout,
886883
int httpClientSocketTimeout,
887884
String contentEncoding,
888885
Map<String, String> metadata,
@@ -923,7 +920,7 @@ private void uploadWithPresignedUrl(
923920
httpClient,
924921
httpRequest,
925922
networkTimeoutInMilli / 1000, // retry timeout
926-
authTimeout, // auth timeout
923+
0,
927924
httpClientSocketTimeout, // socket timeout in ms
928925
getMaxRetries(),
929926
0, // no socket timeout injection

src/main/java/net/snowflake/client/jdbc/telemetry/TelemetryClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ private boolean sendBatch() throws IOException {
368368
: HttpUtil.executeGeneralRequest(
369369
post,
370370
TELEMETRY_HTTP_RETRY_TIMEOUT_IN_SEC,
371-
this.session.getAuthTimeout(),
371+
0,
372372
this.session.getHttpClientSocketTimeout(),
373373
0,
374374
this.session.getHttpClientKey());

0 commit comments

Comments
 (0)