command: implement graceful shutdown for mini cluster

- Introduce MiniClusterCtx to coordinate shutdown across mini services
- Update Master, Volume, Filer, S3, and WebDAV servers to respect context cancellation
- Ensure all resources are cleaned up properly during test teardown
- Integrate MiniClusterCtx in s3tables integration tests
This commit is contained in:
Chris Lu
2026-01-28 10:36:19 -08:00
parent 07002cf54c
commit 01c17478ae
7 changed files with 87 additions and 13 deletions

View File

@@ -311,7 +311,13 @@ func startMaster(masterOption MasterOptions, masterWhiteList []string) {
ms.Topo.HashicorpRaft.LeadershipTransfer()
}
})
select {}
if MiniClusterCtx != nil {
<-MiniClusterCtx.Done()
ms.Shutdown()
grpcS.Stop()
} else {
select {}
}
}
func isSingleMasterMode(peers string) bool {