diff --git a/main.cc b/main.cc index 23f52bd9a0..cc10cce3aa 100644 --- a/main.cc +++ b/main.cc @@ -767,7 +767,9 @@ int main(int ac, char** av) { db::hints::manager::rebalance(cfg->view_hints_directory()).get(); proxy.invoke_on_all([] (service::storage_proxy& local_proxy) { - local_proxy.start_hints_manager(gms::get_local_gossiper().shared_from_this(), service::get_local_storage_service().shared_from_this()); + auto& ss = service::get_local_storage_service(); + ss.register_subscriber(&local_proxy); + local_proxy.start_hints_manager(gms::get_local_gossiper().shared_from_this(), ss.shared_from_this()); }).get(); supervisor::notify("starting messaging service"); diff --git a/service/storage_service.cc b/service/storage_service.cc index cca6df7f18..3b46fd0ab5 100644 --- a/service/storage_service.cc +++ b/service/storage_service.cc @@ -1383,7 +1383,8 @@ future<> storage_service::drain_on_shutdown() { ss._sys_dist_ks.invoke_on_all(&db::system_distributed_keyspace::stop).get(); slogger.info("Drain on shutdown: system distributed keyspace stopped"); - get_storage_proxy().invoke_on_all([] (storage_proxy& local_proxy) { + get_storage_proxy().invoke_on_all([&ss] (storage_proxy& local_proxy) mutable { + ss.unregister_subscriber(&local_proxy); return local_proxy.stop_hints_manager(); }).get(); slogger.info("Drain on shutdown: hints manager is stopped");