-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow setting shutdown timeout for primary and audit instances #4822
base: master
Are you sure you want to change the base?
Changes from all commits
11aaf72
d14d671
599b508
9c0ab38
2ce99db
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -65,6 +65,7 @@ public Settings( | |||||||||||||||
TimeToRestartErrorIngestionAfterFailure = GetTimeToRestartErrorIngestionAfterFailure(); | ||||||||||||||||
DisableExternalIntegrationsPublishing = SettingsReader.Read(SettingsRootNamespace, "DisableExternalIntegrationsPublishing", false); | ||||||||||||||||
TrackInstancesInitialValue = SettingsReader.Read(SettingsRootNamespace, "TrackInstancesInitialValue", true); | ||||||||||||||||
ShutdownTimeout = SettingsReader.Read(SettingsRootNamespace, "ShutdownTimeout", ShutdownTimeout); | ||||||||||||||||
AssemblyLoadContextResolver = static assemblyPath => new PluginAssemblyLoadContext(assemblyPath); | ||||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
|
@@ -180,6 +181,10 @@ public TimeSpan HeartbeatGracePeriod | |||||||||||||||
|
||||||||||||||||
public bool DisableHealthChecks { get; set; } | ||||||||||||||||
|
||||||||||||||||
// The default value is set to the maximum allowed time by the most restrictive | ||||||||||||||||
// hosting platform, which Docker Linux containers. | ||||||||||||||||
public TimeSpan ShutdownTimeout { get; set; } = TimeSpan.FromSeconds(10); | ||||||||||||||||
Comment on lines
+184
to
+186
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 10 seconds is when we get killed, you set the timeout to allow for cancellation. As in:
With external, I think 5 seconds is already plenty So I like your last commits, but if we want to see cancellation to take place this number should be even lower:
Suggested change
|
||||||||||||||||
|
||||||||||||||||
public string GetConnectionString() | ||||||||||||||||
{ | ||||||||||||||||
var settingsValue = SettingsReader.Read<string>(SettingsRootNamespace, "ConnectionString"); | ||||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,12 @@ protected override void UpdateSettings() | |
settings.Set(ServiceControlSettings.EnableFullTextSearchOnBodies, details.EnableFullTextSearchOnBodies.ToString(), version); | ||
settings.Set(ServiceControlSettings.RemoteInstances, RemoteInstanceConverter.ToJson(details.RemoteInstances), version); | ||
|
||
// Windows services allow a maximum of 125 seconds when stopping a service. | ||
// When shutting down or restarting the OS we have no control over the | ||
// shutdown timeout. This is by the installer engine that is run _only_ on | ||
// Windows via SCMU or PowerShell | ||
settings.Set(ServiceControlSettings.ShutdownTimeout, "00:02:00"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not that familiar with this. This is added during an upgrade to the config? |
||
|
||
// Retired settings | ||
settings.RemoveIfRetired(ServiceControlSettings.AuditQueue, version); | ||
settings.RemoveIfRetired(ServiceControlSettings.AuditLogQueue, version); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only gives 5 seconds of "cancellation" which I think is sufficient because it should be a sort of let everything go and log about it but do not delay termination