From 90376d09d9f90424d0dfdc939e5313dd949d49af Mon Sep 17 00:00:00 2001 From: Sailesh Mukil Date: Sun, 13 Dec 2020 18:22:36 -0800 Subject: [PATCH] Restart Dynomite process if it stops running --- .../monitoring/ProcessMonitorTask.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dynomitemanager-core/src/main/java/com/netflix/dynomitemanager/monitoring/ProcessMonitorTask.java b/dynomitemanager-core/src/main/java/com/netflix/dynomitemanager/monitoring/ProcessMonitorTask.java index b356d673..a8b6cb8a 100644 --- a/dynomitemanager-core/src/main/java/com/netflix/dynomitemanager/monitoring/ProcessMonitorTask.java +++ b/dynomitemanager-core/src/main/java/com/netflix/dynomitemanager/monitoring/ProcessMonitorTask.java @@ -98,8 +98,17 @@ public void execute() throws Exception { instanceState.setStorageAlive(storageProxy.isAlive()); logger.info(String.format("ProcessMonitor state: %s, time elapsted to check (micros): %s", instanceState, stopwatch.elapsed(MICROSECONDS))); - + if((!instanceState.isStorageProxyProcessAlive())) { + if (!instanceState.isStorageAlive()) { + logger.error("FATAL: Redis is down."); + // TODO: Take appropriate action. + } + else { + logger.info("Detected Dynomite process is not running. Restarting dynomite."); + } + dynomiteProcess.start(); + } /* if((!instanceState.isStorageProxyAlive() && instanceState.isStorageProxyProcessAlive())) { if (!instanceState.isStorageAlive()) {