|
|
|
@ -210,9 +210,7 @@ class SocketServer(val config: KafkaConfig,
@@ -210,9 +210,7 @@ class SocketServer(val config: KafkaConfig,
|
|
|
|
|
orderedAcceptors.foreach { acceptor => |
|
|
|
|
val endpoint = acceptor.endPoint |
|
|
|
|
debug(s"Wait for authorizer to complete start up on listener ${endpoint.listener}") |
|
|
|
|
authorizerFutures.get(endpoint).foreach { future => |
|
|
|
|
future.join() |
|
|
|
|
} |
|
|
|
|
waitForAuthorizerFuture(acceptor, authorizerFutures) |
|
|
|
|
debug(s"Start processors on listener ${endpoint.listener}") |
|
|
|
|
acceptor.startProcessors(DataPlaneThreadPrefix) |
|
|
|
|
} |
|
|
|
@ -226,7 +224,7 @@ class SocketServer(val config: KafkaConfig,
@@ -226,7 +224,7 @@ class SocketServer(val config: KafkaConfig,
|
|
|
|
|
*/ |
|
|
|
|
def startControlPlaneProcessor(authorizerFutures: Map[Endpoint, CompletableFuture[Void]] = Map.empty): Unit = synchronized { |
|
|
|
|
controlPlaneAcceptorOpt.foreach { controlPlaneAcceptor => |
|
|
|
|
authorizerFutures.get(controlPlaneAcceptor.endPoint).foreach(_.get) |
|
|
|
|
waitForAuthorizerFuture(controlPlaneAcceptor, authorizerFutures) |
|
|
|
|
controlPlaneAcceptor.startProcessors(ControlPlaneThreadPrefix) |
|
|
|
|
info(s"Started control-plane processor for the control-plane acceptor") |
|
|
|
|
} |
|
|
|
@ -380,6 +378,15 @@ class SocketServer(val config: KafkaConfig,
@@ -380,6 +378,15 @@ class SocketServer(val config: KafkaConfig,
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private def waitForAuthorizerFuture(acceptor: Acceptor, |
|
|
|
|
authorizerFutures: Map[Endpoint, CompletableFuture[Void]]): Unit = { |
|
|
|
|
//we can't rely on authorizerFutures.get() due to ephemeral ports. Get the future using listener name |
|
|
|
|
authorizerFutures.foreach { case (endpoint, future) => |
|
|
|
|
if (endpoint.listener() == acceptor.endPoint.listener()) |
|
|
|
|
future.join() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// `protected` for test usage |
|
|
|
|
protected[network] def newProcessor(id: Int, requestChannel: RequestChannel, connectionQuotas: ConnectionQuotas, listenerName: ListenerName, |
|
|
|
|
securityProtocol: SecurityProtocol, memoryPool: MemoryPool): Processor = { |
|
|
|
|