From 4ebd2fa09deccf80dd31ceb65020bad5beaa5ff6 Mon Sep 17 00:00:00 2001 From: Benny Halevy Date: Mon, 7 Aug 2023 14:36:35 +0300 Subject: [PATCH] gossiper: lock_endpoint: change assert to on_internal_error Fixes a code review comment. See https://github.com/scylladb/scylladb/pull/14845#discussion_r1283060243 Signed-off-by: Benny Halevy --- gms/gossiper.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gms/gossiper.cc b/gms/gossiper.cc index 7b40dcf9fa..3ef3877074 100644 --- a/gms/gossiper.cc +++ b/gms/gossiper.cc @@ -782,7 +782,9 @@ gossiper::endpoint_lock_entry::endpoint_lock_entry() noexcept {} future gossiper::lock_endpoint(inet_address ep, permit_id pid, seastar::compat::source_location l) { - assert(this_shard_id() == 0); + if (this_shard_id() != 0) { + on_internal_error(logger, "lock_endpoint must be called on shard 0"); + } std::string caller = l.function_name(); auto eptr = co_await _endpoint_locks.get_or_load(ep, [] (const inet_address& ep) { return endpoint_lock_entry(); }); if (pid) {