diff --git a/src/Tgstation.Server.Host/Components/InstanceManager.cs b/src/Tgstation.Server.Host/Components/InstanceManager.cs index d776370de2..ac0b1d230b 100644 --- a/src/Tgstation.Server.Host/Components/InstanceManager.cs +++ b/src/Tgstation.Server.Host/Components/InstanceManager.cs @@ -461,14 +461,27 @@ namespace Tgstation.Server.Host.Components logger.LogDebug("Stopping instance manager..."); var instanceFactoryStopTask = instanceFactory.StopAsync(cancellationToken); await jobManager.StopAsync(cancellationToken); - await Task.WhenAll(instances.Select(x => x.Value.Instance.StopAsync(cancellationToken))); + + async Task OfflineInstanceImmediate(IInstance instance, CancellationToken cancellationToken) + { + try + { + await instance.StopAsync(cancellationToken); + } + catch (Exception ex) + { + logger.LogError(ex, "Instance shutdown exception!"); + } + } + + await Task.WhenAll(instances.Select(x => OfflineInstanceImmediate(x.Value.Instance, cancellationToken))); await instanceFactoryStopTask; await swarmService.Shutdown(cancellationToken); } catch (Exception ex) { - logger.LogError(ex, "Instance manager stop exception!"); + logger.LogCritical(ex, "Instance manager stop exception!"); } }