diff --git a/gms/gossiper.cc b/gms/gossiper.cc index 1f586832cd..808d458018 100644 --- a/gms/gossiper.cc +++ b/gms/gossiper.cc @@ -1711,11 +1711,10 @@ void gossiper::apply_new_states(inet_address addr, endpoint_state& local_state, } } -// Runs inside seastar::async context -void gossiper::do_before_change_notifications(inet_address addr, const endpoint_state& ep_state, const application_state& ap_state, const versioned_value& new_value) { - _subscribers.for_each([addr, ep_state, ap_state, new_value] (shared_ptr subscriber) { +future<> gossiper::do_before_change_notifications(inet_address addr, const endpoint_state& ep_state, const application_state& ap_state, const versioned_value& new_value) { + co_await _subscribers.for_each([addr, ep_state, ap_state, new_value] (shared_ptr subscriber) { return subscriber->before_change(addr, ep_state, ap_state, new_value); - }).get(); + }); } // Runs inside seastar::async context @@ -2054,7 +2053,7 @@ future<> gossiper::add_local_application_state(std::list do_before_change_notifications(inet_address addr, const endpoint_state& ep_state, const application_state& ap_state, const versioned_value& new_value); // notify that an application state has changed void do_on_change_notifications(inet_address addr, const application_state& state, const versioned_value& value);