Fix a crash while the grpc port is conflict

This commit is contained in:
helifu 2022-08-25 10:56:53 +08:00
parent fec58f7d1b
commit b52e098a40

View File

@ -1862,6 +1862,11 @@ void GRPCServer::start()
queue = builder.AddCompletionQueue();
grpc_server = builder.BuildAndStart();
if (nullptr == grpc_server)
{
throw DB::Exception("Can't start grpc server, there is a port conflict", DB::ErrorCodes::NETWORK_ERROR);
}
runner->start();
}