The function manipulates the endpoint state by calling remove_endpoint and evict_from_membership (and possibly yielding in-between), so it should serialize the state change with lock_endpoint. Signed-off-by: Benny Halevy <bhalevy@scylladb.com>