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