Monitors stop themselves when the Topology is GC'ed.
This commit is contained in:
parent
38848d47f3
commit
21976d9976
@ -44,7 +44,12 @@ class Monitor(object):
|
||||
"""
|
||||
super(Monitor, self).__init__()
|
||||
self._server_description = server_description
|
||||
self._topology = weakref.proxy(topology)
|
||||
|
||||
# A weakref callback, takes ref to the dead topology as its parameter.
|
||||
def close(dummy):
|
||||
self.close()
|
||||
|
||||
self._topology = weakref.proxy(topology, close)
|
||||
self._pool = pool
|
||||
self._settings = topology_settings
|
||||
self._stopped = False
|
||||
|
||||
@ -49,7 +49,6 @@ class TestMonitor(IntegrationTest):
|
||||
ref = wait_until(partial(find_monitor_ref, monitor),
|
||||
'register monitor')
|
||||
|
||||
client.close()
|
||||
del monitor
|
||||
del client
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user