From 2a6e878ee95f93b2237f47f280d0b470eb404607 Mon Sep 17 00:00:00 2001 From: Bhargav Dodla Date: Wed, 22 Jan 2025 21:12:36 +0530 Subject: [PATCH] fix: Simplify shutdown process in __del__() for CassandraOnlineStore --- .../cassandra_online_store.py | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/sdk/python/feast/infra/online_stores/contrib/cassandra_online_store/cassandra_online_store.py b/sdk/python/feast/infra/online_stores/contrib/cassandra_online_store/cassandra_online_store.py index 9281021926..924e20bf2a 100644 --- a/sdk/python/feast/infra/online_stores/contrib/cassandra_online_store/cassandra_online_store.py +++ b/sdk/python/feast/infra/online_stores/contrib/cassandra_online_store/cassandra_online_store.py @@ -447,20 +447,19 @@ def __del__(self): print("Calling CassandraOnlineStore __del__() method") if self._cluster: if not self._cluster.is_shutdown: - print(f"{self._cluster.client_id}: Cluster is still active") - print( - f"{self._cluster.client_id}: Del Control Connection Host {self._cluster.get_control_connection_host()}" - ) - for connection in self._cluster.get_connection_holders(): - print( - f"{self._cluster.client_id}: Del Connection ID: {connection.get_connections()}" - ) - self._cluster.control_connection.shutdown() - if not self._cluster.scheduler.is_shutdown: - print(f"{self._cluster.client_id}: Shutting down scheduler") - self._cluster.scheduler.shutdown() - self._cluster.executor.shutdown() - # self._cluster.shutdown() + # print(f"{self._cluster.client_id}: Cluster is still active") + # print( + # f"{self._cluster.client_id}: Del Control Connection Host {self._cluster.get_control_connection_host()}" + # ) + # for connection in self._cluster.get_connection_holders(): + # print( + # f"{self._cluster.client_id}: Del Connection ID: {connection.get_connections()}" + # ) + # self._cluster.control_connection.shutdown() + # if not self._cluster.scheduler.is_shutdown: + # print(f"{self._cluster.client_id}: Shutting down scheduler") + # self._cluster.scheduler.shutdown() + self._cluster.shutdown() else: print(f"{self._cluster.client_id}: Cluster is not active")