From bc434d1df6012d65c33a4bada9d2889f97137b33 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Mon, 18 May 2020 16:35:39 -0400 Subject: [PATCH] Patch the watchdog shutdown crash --- .../Components/Watchdog/WatchdogBase.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs b/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs index ecfd994cd4..893591612c 100644 --- a/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs +++ b/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs @@ -147,6 +147,11 @@ namespace Tgstation.Server.Host.Components.Watchdog /// bool running; + /// + /// If the has been d. + /// + bool disposed; + /// /// Initializes a new instance of the . /// @@ -216,6 +221,7 @@ namespace Tgstation.Server.Host.Components.Watchdog restartRegistration.Dispose(); DisposeAndNullControllers(); monitorCts?.Dispose(); + disposed = true; } /// @@ -672,7 +678,9 @@ namespace Tgstation.Server.Host.Components.Watchdog false, cancellationToken); - if (monitorState.NextAction != MonitorAction.Exit) + if (disposed) + monitorState.NextAction = MonitorAction.Exit; + else if (monitorState.NextAction != MonitorAction.Exit) monitorState = await MonitorRestart(cancellationToken).ConfigureAwait(false); await chatTask.ConfigureAwait(false);