public void shutdown()

in src/main/java/com/uber/rss/StreamServer.java [288:344]


    public void shutdown(boolean wait) {
        List<Throwable> exceptions = new ArrayList<>();

        try {
            serviceRegistry.close();
        } catch (Throwable e) {
            logger.warn("Unable to shutdown metadata store:", e);
            exceptions.add(e);
        }

        for (Channel c : channels) {
            try {
                c.close();
            } catch (Throwable e) {
                logger.warn(String.format("Unable to shutdown channel %s:", c), e);
                exceptions.add(e);
            }
        }

        Future<?> healthFuture = healthCheckEventLoopGroup.shutdownGracefully();
        Future<?> bossFuture = shuffleBossGroup.shutdownGracefully();
        Future<?> workerFuture = shuffleWorkerGroup.shutdownGracefully();

        try {
            healthFuture.get();
        } catch (Throwable ex) {
            logger.warn("Hit exception when shutting down health check event loop group", ex);
            exceptions.add(ex);
        }

        try {
            bossFuture.get();
        } catch (Throwable ex) {
            logger.warn("Hit exception when shutting down shuffle boss event loop group", ex);
            exceptions.add(ex);
        }
        
        try {
            workerFuture.get();
        } catch (Throwable ex) {
            logger.warn("Hit exception when shutting down shuffle worker event loop group", ex);
            exceptions.add(ex);
        }

        try {
            shuffleExecutor.stop(wait);
        } catch (Throwable e) {
            logger.warn("Unable to shutdown writer executor:", e);
            exceptions.add(e);
        }

        logger.info(String.format("Number of opened files: %s", SystemUtils.getFileDescriptorCount()));
        
        if (!exceptions.isEmpty()) {
            throw new RssAggregateException(exceptions);
        }
    }