Skip to content

Commit

Permalink
fix: Simplify shutdown process in __del__() for CassandraOnlineStore
Browse files Browse the repository at this point in the history
  • Loading branch information
Bhargav Dodla committed Jan 22, 2025
1 parent d22e801 commit 2a6e878
Showing 1 changed file with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 2a6e878

Please sign in to comment.