You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Centralize shutdown data-finalization timeout and add forced-shutdown path
Add configurable data-finalization timeout and wire it through CLI, defaults.conf,
and GarnetServerOptions so shutdown behavior stays consistent across hosts.
- Add --data-finalization-timeout / DataFinalizationTimeoutSeconds (default 15s)
- Replace hardcoded 15s finalize CTS in ShutdownAsync with linked caller token
plus configured cap; skip persistence on noSave or forced cancellation
- Define defaults on GarnetServerOptions (DefaultShutdownTimeoutSeconds,
DefaultDataFinalizationTimeoutSeconds) as single source of truth
- Windows service: HostOptions.ShutdownTimeout = drain + finalize + 5s margin
(replaces fixed 20s buffer); pre-parse both timeout flags
- Console host: second Ctrl+C / ProcessExit during shutdown cancels persistence
(Redis-like fast path) via shutdownForceCts
- Tests: forced cancellation, noSave, and AOF shutdown coverage; fix CS1998
by using void tests with Assert.DoesNotThrowAsync
Copy file name to clipboardExpand all lines: libs/host/Configuration/Options.cs
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -382,6 +382,10 @@ internal sealed class Options : ICloneable
382
382
"The Windows SCM default pre-kill wait is 5 seconds, so values below 5 are not recommended when running as a Windows service.")]
383
383
publicintShutdownTimeoutSeconds{get;set;}
384
384
385
+
[IntRangeValidation(1,int.MaxValue)]
386
+
[Option("data-finalization-timeout",Required=false,HelpText="Timeout in seconds for AOF commit and checkpoint during graceful shutdown data finalization.")]
387
+
publicintDataFinalizationTimeoutSeconds{get;set;}
388
+
385
389
[OptionValidation]
386
390
[Option("use-azure-storage",Required=false,HelpText="Use Azure Page Blobs for storage instead of local storage.")]
387
391
publicbool?UseAzureStorage{get;set;}
@@ -924,6 +928,7 @@ endpoint is IPEndPoint listenEp && clusterAnnounceEndpoint[0] is IPEndPoint anno
0 commit comments