From 42650839b3393db271eb6e1bc0564940ccee18b6 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Sun, 15 Jul 2018 17:23:49 -0400 Subject: [PATCH 1/2] Adds more watchdog logs --- TGS.Server/Instance/DreamDaemon.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/TGS.Server/Instance/DreamDaemon.cs b/TGS.Server/Instance/DreamDaemon.cs index 69b03306df..dff55061cc 100644 --- a/TGS.Server/Instance/DreamDaemon.cs +++ b/TGS.Server/Instance/DreamDaemon.cs @@ -374,7 +374,9 @@ namespace TGS.Server } } - WriteCurrentDDLog("Crash detected!"); + WriteCurrentDDLog("Crash detected! Exit code: ": Proc.ExitCode); + var runtimeS = (DateTime.Now - starttime).TotalSeconds; + WriteWarning("DD crashed: Exit Code: " + Proc.ExitCode + " Seconds running: " + runtimeS); lock (watchdogLock) { @@ -384,7 +386,7 @@ namespace TGS.Server if (AwaitingShutdown == ShutdownRequestPhase.Pinged) return; - var BadStart = (DateTime.Now - starttime).TotalSeconds < DDBadStartTime; + var BadStart = runtimeS < DDBadStartTime; if (BadStart) { ++retries; @@ -619,6 +621,7 @@ namespace TGS.Server { GameAPIVersion = null; //needs updating } + WriteInfo("Starting DD: " + Proc.StartInfo.FileName + " " + Proc.StartInfo.Arguments); Proc.Start(); Proc.PriorityClass = ProcessPriorityClass.AboveNormal; From 4476b3a723fd0b0934b243a894fbe2e5cce97d31 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Sun, 15 Jul 2018 17:43:28 -0400 Subject: [PATCH 2/2] Fix --- TGS.Server/EventID.cs | 8 ++++++++ TGS.Server/Instance/DreamDaemon.cs | 7 ++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/TGS.Server/EventID.cs b/TGS.Server/EventID.cs index 9981fd199f..7f04860da9 100644 --- a/TGS.Server/EventID.cs +++ b/TGS.Server/EventID.cs @@ -331,5 +331,13 @@ namespace TGS.Server /// Warning: When a testmerge commit failed to be published /// ReferencePush = 7700, + /// + /// Warning: When the server exits unexpectedly + /// + DDServerCrash = 7800, + /// + /// Info: When the DreamDaemon process is about to be launched + /// + DDServerStart = 7800, } } diff --git a/TGS.Server/Instance/DreamDaemon.cs b/TGS.Server/Instance/DreamDaemon.cs index dff55061cc..78815061d2 100644 --- a/TGS.Server/Instance/DreamDaemon.cs +++ b/TGS.Server/Instance/DreamDaemon.cs @@ -374,9 +374,10 @@ namespace TGS.Server } } - WriteCurrentDDLog("Crash detected! Exit code: ": Proc.ExitCode); + WriteCurrentDDLog("Crash detected! Exit code: " + Proc.ExitCode); var runtimeS = (DateTime.Now - starttime).TotalSeconds; - WriteWarning("DD crashed: Exit Code: " + Proc.ExitCode + " Seconds running: " + runtimeS); + WriteWarning("DD crashed: Exit Code: " + Proc.ExitCode + " Seconds running: " + runtimeS, EventID.DDServerCrash); + lock (watchdogLock) { @@ -621,7 +622,7 @@ namespace TGS.Server { GameAPIVersion = null; //needs updating } - WriteInfo("Starting DD: " + Proc.StartInfo.FileName + " " + Proc.StartInfo.Arguments); + WriteInfo("Starting DD: " + Proc.StartInfo.FileName + " " + Proc.StartInfo.Arguments, EventID.DDServerStart); Proc.Start(); Proc.PriorityClass = ProcessPriorityClass.AboveNormal;