HeartSaVioR commented on a change in pull request #29350:
URL: https://github.com/apache/spark/pull/29350#discussion_r465477234



##########
File path: 
core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala
##########
@@ -530,10 +530,16 @@ private[history] class FsHistoryProvider(conf: SparkConf, 
clock: Clock)
               // If the file is currently not being tracked by the SHS, add an 
entry for it and try
               // to parse it. This will allow the cleaner code to detect the 
file as stale later on
               // if it was not possible to parse it.
-              listing.write(LogInfo(reader.rootPath.toString(), 
newLastScanTime, LogType.EventLogs,
-                None, None, reader.fileSizeForLastIndex, reader.lastIndex, 
None,
-                reader.completed))
-              reader.fileSizeForLastIndex > 0
+              try {
+                listing.write(LogInfo(reader.rootPath.toString(), 
newLastScanTime,
+                  LogType.EventLogs, None, None, reader.fileSizeForLastIndex, 
reader.lastIndex,
+                  None, reader.completed))
+                reader.fileSizeForLastIndex > 0
+              } catch {
+                case _: FileNotFoundException => false
+              }
+            case _: FileNotFoundException =>

Review comment:
       nit: I'd have empty new line after `}`.




----------------------------------------------------------------
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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to