Our Spark Java application, task got an exception "com.microsoft.sqlserver.jdbc.SQLServerException: java.net.Socket Exception : Connection Reset", while it was running.
It makes a connection with database using following code, and table has millions of records:
session.read().format("jdbc")
.option("url", dbProperties.getProperty("URL"))
.option("driverClass", dbProperties.getProperty("DRIVERCLASS"))
.option("username", dbProperties.getProperty("USERNAME"))
.option("password", dbProperties.getProperty("PASSWORD"))
.option("dbtable", "(" + formattedSQL + ") as " + tablenameDS)
.load();
Is there a way in Apache Spark, that it performs some X connection retries to the database with a delay between retries?
Will increasing the following property "spark.task.maxFailures" default value from 4, fix this issue?