Make sure the session is shutdown on destruction
This commit is contained in:
@@ -14,6 +14,7 @@ Bug Fixes
|
||||
* Avoid to replace a connection that is supposed to shutdown (PYTHON-772)
|
||||
* request_ids may not be returned to the pool (PYTHON-739)
|
||||
* Fix murmur3 on big-endian systems (PYTHON-653)
|
||||
* Ensure unused connections are closed if a Session is deleted by the GC (PYTHON-774)
|
||||
|
||||
Other
|
||||
-----
|
||||
|
@@ -2325,6 +2325,10 @@ class Session(object):
|
||||
def __exit__(self, *args):
|
||||
self.shutdown()
|
||||
|
||||
def __del__(self):
|
||||
# Ensure all connections are closed, in case the Session object is deleted by the GC
|
||||
self.shutdown()
|
||||
|
||||
def add_or_renew_pool(self, host, is_host_addition):
|
||||
"""
|
||||
For internal use only.
|
||||
|
Reference in New Issue
Block a user