snowflake-jdbc icon indicating copy to clipboard operation
snowflake-jdbc copied to clipboard

SNOW-1161547: number of retries is fixed to 0 for getQueryMetadata from queryID

Open XinEDprob opened this issue 1 year ago • 3 comments

Please answer these questions before submitting your issue. In order to accurately debug the issue this information is required. Thanks!

  1. What version of JDBC driver are you using? 3.13.3, however it seems the issue also exists in the current master branch

  2. What operating system and processor architecture are you using? Linux, Intel

  3. What version of Java are you using? Scala 2.12

  4. What did you do? I used snowflake spark connector to load data to snowflake tables in scala.

  5. What did you expect to see?

The load should complete without error, however, sometimes the data load failed with the following error

SnowflakeSQLLoggedException: No response or invalid response from GET request. Error: {}
	at net.snowflake.client.core.SFSession.getQueryStatus(SFSession.java:190)
	at net.snowflake.client.jdbc.SFAsyncResultSet.getStatus(SFAsyncResultSet.java:101)
	at net.snowflake.client.jdbc.SFAsyncResultSet.getRealResults(SFAsyncResultSet.java:162)
	at net.snowflake.client.jdbc.SFAsyncResultSet.getMetaData(SFAsyncResultSet.java:277)
	at net.snowflake.spark.snowflake.io.StageWriter$.executeCopyIntoTable(StageWriter.scala:603)
	at net.snowflake.spark.snowflake.io.StageWriter$.writeToTableWithStagingTable(StageWriter.scala:471)

I took a look at the JDBC code which snowflake spark connector uses. Function getQueryMetadata function is used to obtain query status from the queryID. However, one thing I do not understand is why the fifth parameter of HttpUtil.executeGeneralRequest is hardcoded to 0 which means it is not allowed to have retry. Do we know why the number of tries is set to 0? Is this a bug or intended?

  1. Can you set logging to DEBUG and collect the logs?

    https://community.snowflake.com/s/article/How-to-generate-log-file-on-Snowflake-connectors

  2. What is your Snowflake account identifier, if any? (Optional)

XinEDprob avatar Feb 27 '24 01:02 XinEDprob