gossiper: Store subscribers in an atomic_vector
The new guarantees are a bit better IMHO: Once a subscriber is removed, it is never notified. This was not true in the old code since it would iterate over a copy that would still have that subscriber. Signed-off-by: Rafael Ávila de Espíndola <espindola@scylladb.com>
This commit is contained in:
@@ -323,17 +323,19 @@ future<> gossiping_property_file_snitch::reload_gossiper_state() {
|
||||
return make_ready_future<>();
|
||||
}
|
||||
|
||||
future<> ret = make_ready_future<>();
|
||||
if (_reconnectable_helper) {
|
||||
gms::get_local_gossiper().unregister_(_reconnectable_helper);
|
||||
ret = gms::get_local_gossiper().unregister_(_reconnectable_helper);
|
||||
}
|
||||
|
||||
if (!_prefer_local) {
|
||||
return make_ready_future<>();
|
||||
return ret;
|
||||
}
|
||||
|
||||
_reconnectable_helper = make_shared<reconnectable_snitch_helper>(_my_dc);
|
||||
gms::get_local_gossiper().register_(_reconnectable_helper);
|
||||
return make_ready_future<>();
|
||||
return ret.then([this] {
|
||||
_reconnectable_helper = make_shared<reconnectable_snitch_helper>(_my_dc);
|
||||
gms::get_local_gossiper().register_(_reconnectable_helper);
|
||||
});
|
||||
}
|
||||
|
||||
using registry_2_params = class_registrator<i_endpoint_snitch,
|
||||
|
||||
Reference in New Issue
Block a user