private void tryToStartWeb() { SQProcess process = processesById.get(ProcessId.WEB_SERVER); if (process == null) { return; } if (!isEsClientStartable()) { if (firstWaitingEsLog.getAndSet(false)) { LOG.info("Waiting for Elasticsearch to be up and running"); } return; } if (appState.isOperational(ProcessId.WEB_SERVER, false)) { tryToStartProcess(process, () -> commandFactory.createWebCommand(false)); } else if (appState.tryToLockWebLeader()) { tryToStartProcess(process, () -> commandFactory.createWebCommand(true)); } else { Optional<String> leader = appState.getLeaderHostName(); if (leader.isPresent()) { LOG.info("Waiting for initialization from {}", leader.get()); } else { LOG.error("Initialization failed. All nodes must be restarted"); } } }
private void tryToStartWeb() { SQProcess process = processesById.get(ProcessId.WEB_SERVER); if (process == null) { return; } if (!isEsClientStartable()) { if (firstWaitingEsLog.getAndSet(false)) { LOG.info("Waiting for Elasticsearch to be up and running"); } return; } if (appState.isOperational(ProcessId.WEB_SERVER, false)) { tryToStartProcess(process, () -> commandFactory.createWebCommand(false)); } else if (appState.tryToLockWebLeader()) { tryToStartProcess(process, () -> commandFactory.createWebCommand(true)); } else { Optional<String> leader = appState.getLeaderHostName(); if (leader.isPresent()) { LOG.info("Waiting for initialization from {}", leader.get()); } else { LOG.error("Initialization failed. All nodes must be restarted"); } } }