From 843c3f660e30fef8cc525c24bf2275ad668da3cf Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Sun, 27 Sep 2020 23:51:46 -0400 Subject: [PATCH 1/2] Make WatchdogLaunch event finish before DD starts --- .../Components/Watchdog/BasicWatchdog.cs | 6 +++++- .../Components/Watchdog/WatchdogBase.cs | 12 +++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/Tgstation.Server.Host/Components/Watchdog/BasicWatchdog.cs b/src/Tgstation.Server.Host/Components/Watchdog/BasicWatchdog.cs index cafa447a71..faf935a4e1 100644 --- a/src/Tgstation.Server.Host/Components/Watchdog/BasicWatchdog.cs +++ b/src/Tgstation.Server.Host/Components/Watchdog/BasicWatchdog.cs @@ -192,6 +192,8 @@ namespace Tgstation.Server.Host.Components.Watchdog Logger.LogTrace("Initializing controller with CompileJob {0}...", dmbToUse.CompileJob.Id); await BeforeApplyDmb(dmbToUse.CompileJob, cancellationToken).ConfigureAwait(false); dmbToUse = await PrepServerForLaunch(dmbToUse, cancellationToken).ConfigureAwait(false); + + await chatTask.ConfigureAwait(false); serverLaunchTask = SessionControllerFactory.LaunchNew( dmbToUse, null, @@ -200,7 +202,10 @@ namespace Tgstation.Server.Host.Components.Watchdog cancellationToken); } else + { + await chatTask.ConfigureAwait(false); serverLaunchTask = SessionControllerFactory.Reattach(reattachInfo, cancellationToken); + } // retrieve the session controller Server = await serverLaunchTask.ConfigureAwait(false); @@ -209,7 +214,6 @@ namespace Tgstation.Server.Host.Components.Watchdog if (Server == null) { await ReattachFailure( - chatTask, cancellationToken) .ConfigureAwait(false); return; diff --git a/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs b/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs index a9a18cfccb..e9843b2294 100644 --- a/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs +++ b/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs @@ -474,10 +474,9 @@ namespace Tgstation.Server.Host.Components.Watchdog /// /// Call from when a reattach operation fails to attempt a fresh start. /// - /// A, possibly active, for an outgoing chat message. /// The for the operation. /// A representing the running operation. - protected async Task ReattachFailure(Task chatTask, CancellationToken cancellationToken) + protected async Task ReattachFailure(CancellationToken cancellationToken) { // we lost the server, just restart entirely // DCT: Operation must always run @@ -485,13 +484,8 @@ namespace Tgstation.Server.Host.Components.Watchdog const string FailReattachMessage = "Unable to properly reattach to server! Restarting watchdog..."; Logger.LogWarning(FailReattachMessage); - async Task ChainChatTask() - { - await chatTask.ConfigureAwait(false); - await Chat.SendWatchdogMessage(FailReattachMessage, cancellationToken).ConfigureAwait(false); - } - - await InitControllers(ChainChatTask(), null, cancellationToken).ConfigureAwait(false); + var chatTask = Chat.SendWatchdogMessage(FailReattachMessage, cancellationToken); + await InitControllers(chatTask, null, cancellationToken).ConfigureAwait(false); } /// From 6fb54ec7470ae94f39458c32963a5687a52e331d Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Sun, 27 Sep 2020 23:53:33 -0400 Subject: [PATCH 2/2] Version bump to 4.5.4 --- build/Version.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Version.props b/build/Version.props index f81e36cda4..af9216cd7e 100644 --- a/build/Version.props +++ b/build/Version.props @@ -2,7 +2,7 @@ - 4.5.3 + 4.5.4 2.1.0 7.3.2 8.3.2