Github user skyluc commented on a diff in the pull request:
https://github.com/apache/spark/pull/8433#discussion_r37965919
--- Diff:
core/src/main/scala/org/apache/spark/util/logging/RollingFileAppender.scala ---
@@ -78,33 +78,31 @@ private[spark] class RollingFileAppender(
private def moveFile() {
val rolloverSuffix = rollingPolicy.generateRolledOverFileSuffix()
val rolloverFile = new File(
- activeFile.getParentFile, activeFile.getName +
rolloverSuffix).getAbsoluteFile
- try {
- logDebug(s"Attempting to rollover file $activeFile to file
$rolloverFile")
- if (activeFile.exists) {
- if (!rolloverFile.exists) {
- Files.move(activeFile, rolloverFile)
- logInfo(s"Rolled over $activeFile to $rolloverFile")
- } else {
- // In case the rollover file name clashes, make a unique file
name.
- // The resultant file names are long and ugly, so this is used
only
- // if there is a name collision. This can be avoided by the using
- // the right pattern such that name collisions do not occur.
- var i = 0
- var altRolloverFile: File = null
- do {
- altRolloverFile = new File(activeFile.getParent,
- s"${activeFile.getName}$rolloverSuffix--$i").getAbsoluteFile
- i += 1
- } while (i < 10000 && altRolloverFile.exists)
-
- logWarning(s"Rollover file $rolloverFile already exists, " +
- s"rolled over $activeFile to file $altRolloverFile")
- Files.move(activeFile, altRolloverFile)
- }
+ activeFile.getParentFile, activeFile.getName +
rolloverSuffix).getAbsoluteFile
--- End diff --
Yes, the indent is off.
And yes, the change is just removing the unneeded try block. The method is
private, and already called from a try-catch.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]