[Garnet.Worker] feat: Improve graceful shutdown by add AOF handling or take checkpoint if config enabled #1382
feat: Improve graceful shutdown and add AOF handling
This commit(PR) enhances the asynchronous shutdown process in Worker.cs with the following changes:
- The
StopAsyncmethod now waits up to 30 seconds for existing connections to complete before termination. - Added logic to flush the AOF (Append-Only File) buffer and create a checkpoint on shutdown. This commit operation is only performed if AOF is enabled.
- Implemented the new
WaitForActiveConnectionsToCompletemethod to check the status of active connections with a retry mechanism. - Called
GC.SuppressFinalize(this)in theDisposemethod to prevent unnecessary finalization.
then this PR will Close #1382 Issue (Tested in My side, if you hope you can check also)
umm, I hope my code change didn't impact on cluster test result
CI only failure on test.cluster with windows-latest, net8.0, Release But, test.cluster success with windows-latest, among net9.0(both of Release and Debug), net8.0 with Debug
So how can I find to resolve this issue? I don't have a mind to locally test about clusttering garnet in windows
When before running is successful (https://github.com/microsoft/garnet/actions/runs/18344516902) but today's branch update make CI failure
In my assumption with Local Visual Studio Test excution passed about failed test item, and only failed only one target failure(.net 8, windows, release) and other commit on main branch's actions running result log shows some cluster test failure This is Not our main program failure, I think
I found a issue that I confused AOF and garnet's tiered storage So I modified codes that handle tiered storage checkpoints and AOF commit properly with related #1390 checkpoint is more reliable states compared to AOF