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



##########
File path: core/src/main/scala/kafka/log/LogManager.scala
##########
@@ -479,25 +479,33 @@ class LogManager(logDirs: Seq[File],
 
     try {
       for ((dir, dirJobs) <- jobs) {
-        dirJobs.foreach(_.get)
+        val hasErrors = dirJobs.exists {

Review comment:
       This looks wrong. `exists` short-circuits. I think you want `map` 
followed by `exists`.

##########
File path: core/src/main/scala/kafka/log/LogManager.scala
##########
@@ -479,25 +479,33 @@ class LogManager(logDirs: Seq[File],
 
     try {
       for ((dir, dirJobs) <- jobs) {
-        dirJobs.foreach(_.get)
+        val hasErrors = dirJobs.exists {
+          future =>

Review comment:
       Nit: this should be in the previous line.

##########
File path: core/src/main/scala/kafka/log/LogManager.scala
##########
@@ -479,25 +479,33 @@ class LogManager(logDirs: Seq[File],
 
     try {
       for ((dir, dirJobs) <- jobs) {
-        dirJobs.foreach(_.get)
+        val hasErrors = dirJobs.exists {
+          future =>
+            try {

Review comment:
       You can use `scala.util.Try` to wrap the call and get a `Success` or 
`Failure`.




----------------------------------------------------------------
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


Reply via email to