code: public CompletableFuture<Void> shutdownServer() {
  		CompletableFuture<Void> shutdownFuture = new CompletableFuture<>();
  		if (serverShutdownFuture.compareAndSet(null, shutdownFuture)) {
  			log.info("Shutting down {} @ {}", serverName, serverAddress);
  
  			final CompletableFuture<Void> groupShutdownFuture = new CompletableFuture<>();
  			if (bootstrap != null) {
  				EventLoopGroup group = bootstrap.group();
  				if (group != null && !group.isShutdown()) {
  					group.shutdownGracefully(0L, 0L, TimeUnit.MILLISECONDS)
  							.addListener(finished -> {
  								if (finished.isSuccess()) {
  									groupShutdownFuture.complete(null);
  								} else {
  									groupShutdownFuture.completeExceptionally(finished.cause());
  								}
  							});
  				} else {
  					groupShutdownFuture.complete(null);
  				}
  			} else {
  				groupShutdownFuture.complete(null);
  			}
  
  			final CompletableFuture<Void> handlerShutdownFuture = new CompletableFuture<>();
  			if (handler == null) {
  				handlerShutdownFuture.complete(null);
  			} else {
  				handler.shutdown().whenComplete((result, throwable) -> {
  					if (throwable != null) {
  						handlerShutdownFuture.completeExceptionally(throwable);
  					} else {
  						handlerShutdownFuture.complete(null);
  					}
  				});
  			}
  
  			final CompletableFuture<Void> queryExecShutdownFuture = CompletableFuture.runAsync(() -> {
  				if (queryExecutor != null) {
  					ExecutorUtils.gracefulShutdown(10L, TimeUnit.MINUTES, queryExecutor);
  				}
  			});
  
  			CompletableFuture.allOf(
  					queryExecShutdownFuture, groupShutdownFuture, handlerShutdownFuture
  			).whenComplete((result, throwable) -> {
  				if (throwable != null) {
  					shutdownFuture.completeExceptionally(throwable);
  				} else {
  					shutdownFuture.complete(null);
  				}
  			});
  		}
  		return serverShutdownFuture.get();
  	}
docs: Shuts down the server and all related thread pools.
  @return A {@link CompletableFuture} that will be completed upon termination of the shutdown process.