Skip to content

Commit

Permalink
MINOR: a small refactor for LogManage#shutdown (#9680)
Browse files Browse the repository at this point in the history
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
  • Loading branch information
APaMio authored Dec 4, 2020
1 parent 4cc6d20 commit df0c52e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/main/scala/kafka/log/LogManager.scala
Original file line number Diff line number Diff line change
Expand Up @@ -479,14 +479,14 @@ class LogManager(logDirs: Seq[File],

try {
for ((dir, dirJobs) <- jobs) {
val hasErrors = dirJobs.map { future =>
val hasErrors = dirJobs.exists { future =>
Try(future.get) match {
case Success(_) => false
case Failure(e) =>
warn(s"There was an error in one of the threads during LogManager shutdown: ${e.getCause}")
true
}
}.contains(true)
}

if (!hasErrors) {
val logs = logsInDir(localLogsByDir, dir)
Expand Down

0 comments on commit df0c52e

Please sign in to comment.