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