From 8ef05650d388b096363b82c0405734e282eff9c8 Mon Sep 17 00:00:00 2001 From: Dmitry Kropachev Date: Wed, 7 May 2025 15:05:04 -0400 Subject: [PATCH] Deprecate metadata_request_timeout When I was testing https://github.com/scylladb/python-driver/commit/e4a000fdf6548b1cfde477567304b667fcb4cb96, I have figure that out there is another option that controls system queries timeout - `Cluster.control_connection_timeout`, switched to use it instead of `Cluster.metadata_request_timeout`, but did not remove `Cluster.metadata_request_timeout`. Effectively `Cluster.metadata_request_timeout` is not working, what is working is `Cluster.control_connection_timeout`. To address that let's mark `Cluster.metadata_request_timeout` it as deprecated in favor of `Cluster.control_connection_timeout`, to be removed in next minor release. --- cassandra/cluster.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cassandra/cluster.py b/cassandra/cluster.py index fd73803eb8..08ed291dbe 100644 --- a/cassandra/cluster.py +++ b/cassandra/cluster.py @@ -1082,6 +1082,8 @@ def default_retry_policy(self, policy): metadata_request_timeout = datetime.timedelta(seconds=2) """ + Deprecated: use control_connection_timeout instead. + Timeout for all queries used by driver it self. Supported only by Scylla clusters. """ @@ -1300,6 +1302,7 @@ def __init__(self, self.auth_provider = auth_provider if metadata_request_timeout is not None: + warn("metadata_request_timeout is deprecated: use control_connection_timeout instead", DeprecationWarning) self.metadata_request_timeout = metadata_request_timeout if load_balancing_policy is not None: