mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-27 15:07:03 +01:00
Fix issue with DMAPI validation shutdown timeouts
- Increase grace period to 30s to avoid false positives.
This commit is contained in:
@@ -16,6 +16,7 @@ TGS_DEFINE_AND_SET_GLOBAL(tgs, null)
|
||||
TGS_DEBUG_LOG("About to terminate world. Tick: [world.time], sleep_offline: [world.sleep_offline]")
|
||||
world.sleep_offline = FALSE // https://www.byond.com/forum/post/2894866
|
||||
del(world)
|
||||
world.sleep_offline = FALSE // just in case, this is BYOND after all...
|
||||
sleep(1)
|
||||
TGS_DEBUG_LOG("BYOND DIDN'T TERMINATE THE WORLD!!! TICK IS: [world.time], sleep_offline: [world.sleep_offline]")
|
||||
|
||||
|
||||
@@ -689,10 +689,12 @@ namespace Tgstation.Server.Host.Components.Session
|
||||
return;
|
||||
}
|
||||
|
||||
Logger.LogDebug("Server will terminated in 10s if it does not exit...");
|
||||
var delayTask = asyncDelayer.Delay(TimeSpan.FromSeconds(10), CancellationToken.None); // DCT: None available
|
||||
var completedTask = await Task.WhenAny(process.Lifetime, delayTask);
|
||||
if (completedTask == delayTask)
|
||||
const int GracePeriodSeconds = 30;
|
||||
Logger.LogDebug("Server will terminated in {gracePeriodSeconds}s if it does not exit...", GracePeriodSeconds);
|
||||
var delayTask = asyncDelayer.Delay(TimeSpan.FromSeconds(GracePeriodSeconds), CancellationToken.None); // DCT: None available
|
||||
await Task.WhenAny(process.Lifetime, delayTask);
|
||||
|
||||
if (!process.Lifetime.IsCompleted)
|
||||
{
|
||||
Logger.LogWarning("DMAPI took too long to shutdown server after validation request!");
|
||||
process.Terminate();
|
||||
|
||||
Reference in New Issue
Block a user