PYTHON-4021 Fix previous topologyDescription published when closing a client (#1769)
This commit is contained in:
parent
3d936d5c7d
commit
d28ceb2058
@ -645,6 +645,7 @@ class Topology:
|
||||
:exc:`~.errors.InvalidOperation`.
|
||||
"""
|
||||
async with self._lock:
|
||||
old_td = self._description
|
||||
for server in self._servers.values():
|
||||
await server.close()
|
||||
|
||||
@ -664,7 +665,6 @@ class Topology:
|
||||
# Publish only after releasing the lock.
|
||||
if self._publish_tp:
|
||||
assert self._events is not None
|
||||
old_td = self._description
|
||||
self._description = TopologyDescription(
|
||||
TOPOLOGY_TYPE.Unknown,
|
||||
{},
|
||||
|
||||
@ -643,6 +643,7 @@ class Topology:
|
||||
:exc:`~.errors.InvalidOperation`.
|
||||
"""
|
||||
with self._lock:
|
||||
old_td = self._description
|
||||
for server in self._servers.values():
|
||||
server.close()
|
||||
|
||||
@ -662,7 +663,6 @@ class Topology:
|
||||
# Publish only after releasing the lock.
|
||||
if self._publish_tp:
|
||||
assert self._events is not None
|
||||
old_td = self._description
|
||||
self._description = TopologyDescription(
|
||||
TOPOLOGY_TYPE.Unknown,
|
||||
{},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user