Merge pull request #1510 from tgstation/OtherFixes

Fix bad swarm abort calls
This commit is contained in:
Jordan Dominion
2023-06-03 07:45:07 -04:00
committed by GitHub
4 changed files with 23 additions and 7 deletions
@@ -885,7 +885,6 @@ namespace Tgstation.Server.Host.Components.Chat
catch (OperationCanceledException ex)
{
logger.LogTrace(ex, "Command processing canceled!");
throw;
}
catch (Exception e)
{
@@ -898,8 +897,7 @@ namespace Tgstation.Server.Host.Components.Chat
{
Text = "TGS: Internal error processing command! Check server logs!",
},
cancellationToken)
;
cancellationToken);
}
finally
{
@@ -413,7 +413,8 @@ namespace Tgstation.Server.Host.Components.Session
try
{
networkPromptReaper.RegisterProcess(process);
if (!byondLock.SupportsCli)
networkPromptReaper.RegisterProcess(process);
var chatTrackingContext = chat.CreateTrackingContext();
try
@@ -531,7 +532,8 @@ namespace Tgstation.Server.Host.Components.Session
else if (sessionConfiguration.LowPriorityDeploymentProcesses)
process.AdjustPriority(false);
networkPromptReaper.RegisterProcess(process);
if (!byondLock.SupportsCli)
networkPromptReaper.RegisterProcess(process);
// If this isnt a staging DD (From a Deployment), fire off an event
if (!apiValidate)
@@ -539,7 +541,7 @@ namespace Tgstation.Server.Host.Components.Session
EventType.DreamDaemonLaunch,
new List<string>
{
process.Id.ToString(CultureInfo.InvariantCulture),
process.Id.ToString(CultureInfo.InvariantCulture),
},
cancellationToken);
@@ -179,6 +179,11 @@ namespace Tgstation.Server.Host.Swarm
/// </summary>
bool serversDirty;
/// <summary>
/// If we've sent out a remote commit message for an update operation.
/// </summary>
bool updateCommitSent;
/// <summary>
/// Initializes static members of the <see cref="SwarmService"/> class.
/// </summary>
@@ -425,6 +430,8 @@ namespace Tgstation.Server.Host.Swarm
}
}
updateCommitSent = true;
Task task;
lock (swarmServers)
task = Task.WhenAll(
@@ -725,7 +732,12 @@ namespace Tgstation.Server.Host.Swarm
return;
logger.LogInformation("Unregistering node {nodeId}...", nodeIdentifier);
await AbortUpdate(cancellationToken);
if (!updateCommitSent)
await AbortUpdate(cancellationToken);
else
logger.LogTrace("Not aborting update because we have committed");
lock (swarmServers)
{
swarmServers.RemoveAll(x => x.Identifier == nodeIdentifier);
@@ -25,6 +25,10 @@
<DockerfileContext>..\..</DockerfileContext>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants>$(DefineConstants);WATCHDOG_FREE_RESTART</DefineConstants>
</PropertyGroup>
<Target Name="ClientInstall" BeforeTargets="ResolveAssemblyReferences" Inputs="../../build/ControlPanelVersion.props" Outputs="$(NpmInstallStampFile)">
<Message Text="Pulling web control panel..." Importance="high" />
<RemoveDir Directories="ClientApp" />