Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@ public class GrpcServer implements ServerInterface {

private final Server server;
private final int port;
private final ExecutorService pool;

public GrpcServer(RssBaseConf conf, BindableService service, GRPCMetrics grpcMetrics) {
this.port = conf.getInteger(RssBaseConf.RPC_SERVER_PORT);
long maxInboundMessageSize = conf.getLong(RssBaseConf.RPC_MESSAGE_MAX_SIZE);
int rpcExecutorSize = conf.getInteger(RssBaseConf.RPC_EXECUTOR_SIZE);
ExecutorService pool = new ThreadPoolExecutor(
pool = new ThreadPoolExecutor(
rpcExecutorSize,
rpcExecutorSize * 2,
10,
Expand Down Expand Up @@ -89,6 +90,9 @@ public void stop() throws InterruptedException {
server.shutdown().awaitTermination(10, TimeUnit.SECONDS);
LOG.info("GRPC server stopped!");
}
if (pool != null) {
pool.shutdown();
}
}

public void blockUntilShutdown() throws InterruptedException {
Expand Down