Skip to content

Commit c13c1ad

Browse files
Set the default shutdown timeout to 5 seconds
1 parent 344b31c commit c13c1ad

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

src/ServiceControl.Audit.UnitTests/ApprovalFiles/APIApprovals.PlatformSampleSettings.approved.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@
2929
"ServiceControlQueueAddress": "Particular.ServiceControl",
3030
"TimeToRestartAuditIngestionAfterFailure": "00:01:00",
3131
"EnableFullTextSearchOnBodies": true,
32-
"ShutdownTimeout": "00:02:00"
32+
"ShutdownTimeout": "00:00:05"
3333
}

src/ServiceControl.Audit/Infrastructure/Settings/Settings.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,11 @@ public int MaxBodySizeToStore
153153

154154
public bool EnableFullTextSearchOnBodies { get; set; }
155155

156-
// Windows services allow a maximum of 125 seconds when stopping a service.
157-
// When shutting down or restarting the OS we have no control over the
158-
// shutdown timeout
159-
public TimeSpan ShutdownTimeout { get; set; } = TimeSpan.FromMinutes(2);
156+
// The default value is set to the maximum allowed time by the most
157+
// restrictive hosting platform, which is Linux containers. Linux
158+
// containers allow for a maximum of 10 seconds. We set it to 5 to
159+
// allow for cancellation and logging to take place
160+
public TimeSpan ShutdownTimeout { get; set; } = TimeSpan.FromSeconds(5);
160161

161162
public TransportSettings ToTransportSettings()
162163
{

src/ServiceControl.UnitTests/ApprovalFiles/APIApprovals.PlatformSampleSettings.approved.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@
4343
"RetryHistoryDepth": 10,
4444
"RemoteInstances": [],
4545
"DisableHealthChecks": false,
46-
"ShutdownTimeout": "00:02:00"
46+
"ShutdownTimeout": "00:00:05"
4747
}

src/ServiceControl/Infrastructure/Settings/Settings.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,10 @@ public TimeSpan HeartbeatGracePeriod
181181

182182
public bool DisableHealthChecks { get; set; }
183183

184-
// The default value is set to the maximum allowed time by the most restrictive
185-
// hosting platform, which Docker Linux containers minus a few seconds
186-
// to actually allow for cancellation and logging to take place
184+
// The default value is set to the maximum allowed time by the most
185+
// restrictive hosting platform, which is Linux containers. Linux
186+
// containers allow for a maximum of 10 seconds. We set it to 5 to
187+
// allow for cancellation and logging to take place
187188
public TimeSpan ShutdownTimeout { get; set; } = TimeSpan.FromSeconds(5);
188189

189190
public string GetConnectionString()

0 commit comments

Comments
 (0)