Merge pull request #795 from datastax/python-774
PYTHON-774: Ensure unused connections are closed if a Session is deleted by the GC
This commit is contained in:
commit
5a06b76d15
|
@ -15,6 +15,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.
|
||||
|
|
Loading…
Reference in New Issue