diff --git a/src/main/java/net/snowflake/client/core/SFBaseSession.java b/src/main/java/net/snowflake/client/core/SFBaseSession.java index 15bc3a21db..ecc1281d23 100644 --- a/src/main/java/net/snowflake/client/core/SFBaseSession.java +++ b/src/main/java/net/snowflake/client/core/SFBaseSession.java @@ -1310,6 +1310,7 @@ public SFConnectionHandler getSfConnectionHandler() { /** * @return auth timeout in seconds */ + @Deprecated public abstract int getAuthTimeout(); /** diff --git a/src/main/java/net/snowflake/client/core/SFSession.java b/src/main/java/net/snowflake/client/core/SFSession.java index da2edb5081..b6b148dbe2 100644 --- a/src/main/java/net/snowflake/client/core/SFSession.java +++ b/src/main/java/net/snowflake/client/core/SFSession.java @@ -110,7 +110,7 @@ public class SFSession extends SFBaseSession { */ private int networkTimeoutInMilli = 0; // in milliseconds - private int authTimeout = 0; + @Deprecated private int authTimeout = 0; private boolean enableCombineDescribe = false; private Duration httpClientConnectionTimeout = HttpUtil.getConnectionTimeout(); private Duration httpClientSocketTimeout = HttpUtil.getSocketTimeout(); @@ -232,7 +232,7 @@ private JsonNode getQueryMetadata(String queryID) throws SQLException { HttpUtil.executeGeneralRequest( get, loginTimeout, - authTimeout, + 0, (int) httpClientSocketTimeout.toMillis(), maxHttpRetries, getHttpClientKey()); @@ -1139,7 +1139,7 @@ protected void heartbeat() throws SFException, SQLException { HttpUtil.executeGeneralRequest( postRequest, SF_HEARTBEAT_TIMEOUT, - authTimeout, + 0, (int) httpClientSocketTimeout.toMillis(), 0, getHttpClientKey()); diff --git a/src/main/java/net/snowflake/client/core/SessionUtil.java b/src/main/java/net/snowflake/client/core/SessionUtil.java index 2fd26eaef2..3fbab15ee2 100644 --- a/src/main/java/net/snowflake/client/core/SessionUtil.java +++ b/src/main/java/net/snowflake/client/core/SessionUtil.java @@ -1394,7 +1394,7 @@ static void closeSession(SFLoginInput loginInput) throws SFException, SnowflakeS HttpUtil.executeGeneralRequest( postRequest, loginInput.getLoginTimeout(), - loginInput.getAuthTimeout(), + 0, loginInput.getSocketTimeoutInMillis(), 0, loginInput.getHttpClientSettingsKey()); diff --git a/src/main/java/net/snowflake/client/core/StmtUtil.java b/src/main/java/net/snowflake/client/core/StmtUtil.java index cde909a18e..cfd85811e1 100644 --- a/src/main/java/net/snowflake/client/core/StmtUtil.java +++ b/src/main/java/net/snowflake/client/core/StmtUtil.java @@ -380,8 +380,8 @@ public static StmtOutput execute(StmtInput stmtInput, ExecTimeTelemetryData exec HttpUtil.executeRequest( httpRequest, stmtInput.networkTimeoutInMillis / 1000, - stmtInput.socketTimeout, 0, + stmtInput.socketTimeout, stmtInput.maxRetries, stmtInput.injectSocketTimeout, stmtInput.canceling, @@ -621,8 +621,8 @@ protected static String getQueryResult(String getResultPath, StmtInput stmtInput return HttpUtil.executeRequest( httpRequest, stmtInput.networkTimeoutInMillis / 1000, - stmtInput.socketTimeout, 0, + stmtInput.socketTimeout, stmtInput.maxRetries, 0, stmtInput.canceling, diff --git a/src/main/java/net/snowflake/client/jdbc/DefaultResultStreamProvider.java b/src/main/java/net/snowflake/client/jdbc/DefaultResultStreamProvider.java index 237abc8969..a28c8c65de 100644 --- a/src/main/java/net/snowflake/client/jdbc/DefaultResultStreamProvider.java +++ b/src/main/java/net/snowflake/client/jdbc/DefaultResultStreamProvider.java @@ -136,7 +136,7 @@ else if (context.getQrmk() != null) { httpClient, httpRequest, context.getNetworkTimeoutInMilli() / 1000, // retry timeout - context.getAuthTimeout(), + 0, context.getSocketTimeout(), 0, 0, // no socket timeout injection diff --git a/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeGCSClient.java b/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeGCSClient.java index 4f54b7e1fa..b3248a2f44 100644 --- a/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeGCSClient.java +++ b/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeGCSClient.java @@ -240,7 +240,7 @@ public void download( httpClient, httpRequest, session.getNetworkTimeoutInMilli() / 1000, // retry timeout - session.getAuthTimeout(), + 0, session.getHttpClientSocketTimeout(), getMaxRetries(), 0, // no socket timeout injection @@ -426,7 +426,7 @@ public InputStream downloadToStream( httpClient, httpRequest, session.getNetworkTimeoutInMilli() / 1000, // retry timeout - session.getAuthTimeout(), + 0, session.getHttpClientSocketTimeout(), getMaxRetries(), 0, // no socket timeout injection @@ -619,7 +619,6 @@ public void uploadWithPresignedUrlWithoutConnection( uploadWithPresignedUrl( networkTimeoutInMilli, - 0, // auth timeout (int) HttpUtil.getSocketTimeout().toMillis(), meta.getContentEncoding(), meta.getUserMetadata(), @@ -711,7 +710,6 @@ public void upload( logger.debug("Starting upload with downscope token", false); uploadWithPresignedUrl( session.getNetworkTimeoutInMilli(), - session.getAuthTimeout(), session.getHttpClientSocketTimeout(), meta.getContentEncoding(), meta.getUserMetadata(), @@ -882,7 +880,6 @@ private void uploadWithDownScopedToken( */ private void uploadWithPresignedUrl( int networkTimeoutInMilli, - int authTimeout, int httpClientSocketTimeout, String contentEncoding, Map metadata, @@ -923,7 +920,7 @@ private void uploadWithPresignedUrl( httpClient, httpRequest, networkTimeoutInMilli / 1000, // retry timeout - authTimeout, // auth timeout + 0, httpClientSocketTimeout, // socket timeout in ms getMaxRetries(), 0, // no socket timeout injection diff --git a/src/main/java/net/snowflake/client/jdbc/telemetry/TelemetryClient.java b/src/main/java/net/snowflake/client/jdbc/telemetry/TelemetryClient.java index 13b2fb9d2c..1b3e4f6db0 100644 --- a/src/main/java/net/snowflake/client/jdbc/telemetry/TelemetryClient.java +++ b/src/main/java/net/snowflake/client/jdbc/telemetry/TelemetryClient.java @@ -368,7 +368,7 @@ private boolean sendBatch() throws IOException { : HttpUtil.executeGeneralRequest( post, TELEMETRY_HTTP_RETRY_TIMEOUT_IN_SEC, - this.session.getAuthTimeout(), + 0, this.session.getHttpClientSocketTimeout(), 0, this.session.getHttpClientKey());