garnet icon indicating copy to clipboard operation
garnet copied to clipboard

[Garnet.Worker] feat: Improve graceful shutdown by add AOF handling or take checkpoint if config enabled #1382

Open yuseok-kim-edushare opened this issue 3 months ago • 3 comments

feat: Improve graceful shutdown and add AOF handling

This commit(PR) enhances the asynchronous shutdown process in Worker.cs with the following changes:

  • The StopAsync method 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 WaitForActiveConnectionsToComplete method to check the status of active connections with a retry mechanism.
  • Called GC.SuppressFinalize(this) in the Dispose method to prevent unnecessary finalization.

then this PR will Close #1382 Issue (Tested in My side, if you hope you can check also)

yuseok-kim-edushare avatar Sep 16 '25 15:09 yuseok-kim-edushare

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

yuseok-kim-edushare avatar Oct 10 '25 00:10 yuseok-kim-edushare

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

yuseok-kim-edushare avatar Oct 10 '25 02:10 yuseok-kim-edushare

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

yuseok-kim-edushare avatar Oct 10 '25 04:10 yuseok-kim-edushare