mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-31 00:50:45 +01:00
Fix using the wrong task when awaiting reboots for topic requests
This commit is contained in:
@@ -1044,7 +1044,7 @@ namespace Tgstation.Server.Host.Components.Session
|
||||
return null;
|
||||
}
|
||||
|
||||
var rebootGate = RebootGate;
|
||||
var reboot = OnReboot;
|
||||
if (!bypassLaunchResult)
|
||||
{
|
||||
var launchResult = await LaunchResult.WaitAsync(cancellationToken);
|
||||
@@ -1068,11 +1068,11 @@ namespace Tgstation.Server.Host.Components.Session
|
||||
{
|
||||
try
|
||||
{
|
||||
var completed = await Task.WhenAny(Lifetime, rebootGate).WaitAsync(combinedCancellationToken);
|
||||
var completed = await Task.WhenAny(Lifetime, reboot).WaitAsync(combinedCancellationToken);
|
||||
|
||||
Logger.LogDebug(
|
||||
"Server {action}, cancelling pending command: {commandType}",
|
||||
completed != rebootGate
|
||||
completed != reboot
|
||||
? "process ended"
|
||||
: "rebooting",
|
||||
parameters.CommandType);
|
||||
|
||||
@@ -1478,24 +1478,11 @@ namespace Tgstation.Server.Tests.Live
|
||||
var chatReadTask = instanceClient.ChatBots.List(null, cancellationToken);
|
||||
|
||||
// Check the DMAPI got the channels again https://github.com/tgstation/tgstation-server/issues/1490
|
||||
var tries = 3;
|
||||
while (true)
|
||||
try
|
||||
{
|
||||
// HEY I THINK I FOUND A WAY TO RELIABLY REPRODUCE THE TOPIC HANG
|
||||
// JUST SET A BREAKPOINT IN THE CATCH
|
||||
// Maybe, with enough investigation, either I can figure out the cause or get Lummox to tell me
|
||||
topicRequestResult = await WatchdogTest.StaticTopicClient.SendTopic(
|
||||
IPAddress.Loopback,
|
||||
$"tgs_integration_test_tactics7=1",
|
||||
mainDDPort,
|
||||
cancellationToken);
|
||||
break;
|
||||
}
|
||||
catch (OperationCanceledException) when (--tries > 0)
|
||||
{
|
||||
await Task.Delay(TimeSpan.FromSeconds(5), cancellationToken);
|
||||
}
|
||||
topicRequestResult = await WatchdogTest.StaticTopicClient.SendTopic(
|
||||
IPAddress.Loopback,
|
||||
$"tgs_integration_test_tactics7=1",
|
||||
mainDDPort,
|
||||
cancellationToken);
|
||||
|
||||
Assert.IsNotNull(topicRequestResult);
|
||||
if(!Int32.TryParse(topicRequestResult.StringData, out var channelsPresent))
|
||||
|
||||
Reference in New Issue
Block a user