From 93ca9e55ea135767795d5b58770453d904088263 Mon Sep 17 00:00:00 2001 From: Yaniv Michael Kaul Date: Sat, 27 Jun 2026 14:52:01 +0300 Subject: [PATCH] fix: _set_keyspace_for_all_pools passes only the last pool's errors to callback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The pool_finished_setting_keyspace closure was calling callback(host_errors) instead of callback(errors), so when the last pool to finish had no errors, the callback received an empty list instead of the accumulated error dict from all pools. This caused _set_keyspace_completed to report success (not [] is True) even when other pools had failures — keyspace changes silently succeeded with partial failures dropped. Introduced in d281b50c9 (2013-10-11). Fixes #914 --- cassandra/cluster.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cassandra/cluster.py b/cassandra/cluster.py index 1181c6f686..fdbdfb8d70 100644 --- a/cassandra/cluster.py +++ b/cassandra/cluster.py @@ -3439,7 +3439,7 @@ def pool_finished_setting_keyspace(pool, host_errors): errors[pool.host] = host_errors if not remaining_callbacks: - callback(host_errors) + callback(errors) for pool in tuple(self._pools.values()): pool._set_keyspace_for_all_conns(keyspace, pool_finished_setting_keyspace)