From 11c5a972c5522aae1ff72837870f46b3e1ac9195 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Tue, 1 Dec 2020 20:45:38 -0500 Subject: [PATCH] Fix the possibility of watchdog starting twice. This can happen if the initial Status check in Launch passes and blocks on the lock before Status is set to Restoring. It needs to be checked again. --- src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs b/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs index e9843b2294..83ed8294c1 100644 --- a/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs +++ b/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs @@ -360,6 +360,8 @@ namespace Tgstation.Server.Host.Components.Watchdog CancellationToken cancellationToken) { Logger.LogTrace("Begin LaunchImplNoLock"); + if (startMonitor && Status != WatchdogStatus.Offline) + throw new JobException(ErrorCode.WatchdogRunning); if (reattachInfo == null && !DmbFactory.DmbAvailable) throw new JobException(ErrorCode.WatchdogCompileJobCorrupted);