main: stop storage_service on shutdown

Just like other services, storage_service needs to be stopped on
shutdown. cql_test_env already stops it, so there is some precedent
for it working. I tested a shutdown while cassandra-stress was
running and it worked okay for a few trials.
This commit is contained in:
Avi Kivity
2021-10-17 17:40:05 +03:00
parent 4f3b8f38e2
commit e6b34527c1

View File

@@ -851,6 +851,11 @@ int main(int ac, char** av) {
std::ref(feature_service), sscfg, std::ref(mm), std::ref(token_metadata),
std::ref(messaging), std::ref(cdc_generation_service), std::ref(repair),
std::ref(raft_gr), std::ref(lifecycle_notifier)).get();
auto stop_storage_service = defer_verbose_shutdown("storage_service", [&] {
ss.stop().get();
});
supervisor::notify("starting per-shard database core");
sst_dir_semaphore.start(cfg->initial_sstable_loading_concurrency()).get();