Skip to content

Commit

Permalink
KAFKA-16232: kafka hangs forever in the starting process if the autho…
Browse files Browse the repository at this point in the history
…rizer future is not returned (#15549)

add logs before and after future waiting, to allow admin to know we're waiting for the authorizer future.

Reviewers: Luke Chen <[email protected]>
  • Loading branch information
brandboat authored Mar 28, 2024
1 parent f40c066 commit 4cb6806
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/src/main/scala/kafka/server/KafkaServer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -617,17 +617,22 @@ class KafkaServer(
}
}
}

val enableRequestProcessingFuture = socketServer.enableRequestProcessing(authorizerFutures)
// Block here until all the authorizer futures are complete
try {
info("Start processing authorizer futures")
CompletableFuture.allOf(authorizerFutures.values.toSeq: _*).join()
info("End processing authorizer futures")
} catch {
case t: Throwable => throw new RuntimeException("Received a fatal error while " +
"waiting for all of the authorizer futures to be completed.", t)
}
// Wait for all the SocketServer ports to be open, and the Acceptors to be started.
try {
info("Start processing enable request processing future")
enableRequestProcessingFuture.join()
info("End processing enable request processing future")
} catch {
case t: Throwable => throw new RuntimeException("Received a fatal error while " +
"waiting for the SocketServer Acceptors to be started.", t)
Expand Down

0 comments on commit 4cb6806

Please sign in to comment.