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 <bhalevy@scylladb.com>
This commit is contained in:
Benny Halevy
2023-08-07 14:36:35 +03:00
parent 6f037549ac
commit 4ebd2fa09d

View File

@@ -782,7 +782,9 @@ gossiper::endpoint_lock_entry::endpoint_lock_entry() noexcept
{}
future<gossiper::endpoint_permit> 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) {