The master-is-stable indicator will retrieve useful information
regarding the discovery. This will be useful even if the local
cluster state is not recovered.

We currently do not evaluate the instance-has-master indicator
if the cluster state is not recovered, but we should remove this
constraint once master-is-stable is merged
server/src/main/java/org/elasticsearch/node/Node.java
toClose.add(injector.getInstance(ReadinessService.class));
        }
        for (LifecycleComponent plugin : pluginLifecycleComponents) {
            toClose.add(() -> stopWatch.stop().start("plugin(" + plugin.getClass().getName() + ")"));
            toClose.add(plugin);
        }
        toClose.addAll(pluginsService.filterPlugins(Plugin.class));
        toClose.add(() -> stopWatch.stop().start("script"));
        toClose.add(injector.getInstance(ScriptService.class));
        toClose.add(() -> stopWatch.stop().start("thread_pool"));
        toClose.add(() -> injector.getInstance(ThreadPool.class).shutdown());
        
        
        
        toClose.add(() -> stopWatch.stop().start("gateway_meta_state"));
        toClose.add(injector.getInstance(GatewayMetaState.class));
        toClose.add(() -> stopWatch.stop().start("node_environment"));
        toClose.add(injector.getInstance(NodeEnvironment.class));
        toClose.add(stopWatch::stop);
        if (logger.isTraceEnabled()) {
            toClose.add(() -> logger.trace("Close times for each service:\n{}", stopWatch.prettyPrint()));
        }
        IOUtils.close(toClose);
        logger.info("closed");
    }
    /**
     * Wait for this node to be effectively closed.
     */
    
    public synchronized boolean awaitClose(long timeout, TimeUnit timeUnit) throws InterruptedException {