From 3293c4568295d568f16cb34393c70fe656d0d7f0 Mon Sep 17 00:00:00 2001 From: Benny Halevy Date: Wed, 26 Jul 2023 13:49:18 +0300 Subject: [PATCH] gossiper: remove_endpoint: lock_endpoint if needed lock_endpoint to serialize changes to endpoint state and calling the on_remove notification. Signed-off-by: Benny Halevy --- gms/gossiper.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gms/gossiper.cc b/gms/gossiper.cc index 2e2af72df9..c1b00c02d1 100644 --- a/gms/gossiper.cc +++ b/gms/gossiper.cc @@ -662,7 +662,8 @@ future<> gossiper::force_remove_endpoint(inet_address endpoint, permit_id pid) { } future<> gossiper::remove_endpoint(inet_address endpoint, permit_id pid) { - // FIXME: lock_endpoint (with null pid) + auto permit = co_await lock_endpoint(endpoint, pid); + pid = permit.id(); // do subscribers first so anything in the subscriber that depends on gossiper state won't get confused try {