You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2020/11/23 22:42:58 UTC

[GitHub] [kafka] ijuma commented on a change in pull request #9643: MINOR: Upgrade to Scala 2.13.4 and 2.12.13

ijuma commented on a change in pull request #9643:
URL: https://github.com/apache/kafka/pull/9643#discussion_r529043449



##########
File path: core/src/main/scala/kafka/log/Log.scala
##########
@@ -2418,13 +2418,11 @@ class Log(@volatile private var _dir: File,
       info(s"Replacing overflowed segment $segment with split segments $newSegments")
       replaceSegments(newSegments.toList, List(segment))
       newSegments.toList
-    } catch {
-      case e: Exception =>
-        newSegments.foreach { splitSegment =>
-          splitSegment.close()
-          splitSegment.deleteIfExists()
-        }
-        throw e
+    } finally {
+      newSegments.foreach { splitSegment =>
+        splitSegment.close()
+        splitSegment.deleteIfExists()
+      }

Review comment:
       @dhruvilshah3 Is there a reason why we had a try/catch with a rethrow instead of using `finally`? spotBugs complained about it and hence the question.




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