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:
Alan Boudreault 2017-07-13 08:00:56 -04:00 committed by GitHub
commit 5a06b76d15
2 changed files with 5 additions and 0 deletions

View File

@ -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
-----

View File

@ -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.