HeartSaVioR commented on a change in pull request #25333: [SPARK-28597][SS] Add 
config to retry spark streaming's meta log when it met error
URL: https://github.com/apache/spark/pull/25333#discussion_r310841725
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/HDFSMetadataLog.scala
 ##########
 @@ -133,7 +140,12 @@ class HDFSMetadataLog[T <: AnyRef : 
ClassTag](sparkSession: SparkSession, path:
           s"Multiple streaming queries are concurrently using $path", e)
       case e: Throwable =>
         output.cancel()
-        throw e
+        if (retryCount > metaDataNumRetries) {
+          throw new IOException(
+            s"Failed to write meta data log after retry $metaDataNumRetries 
count", e)
+        } else {
+          writeBatchToFileWithRetries(metadata, path, retryCount + 1)
 
 Review comment:
   I understand what @gaborgsomogyi meant as use loop instead of recursive 
call, especially it's fairly easy to just use loop. This is even not a tail 
recursive so while I guess retryCount will be small number in practice it's not 
a good idea to do so.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to