File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ Bug Fixes
1111* Use of DCAwareRoundRobinPolicy raises NoHostAvailable exception (PYTHON-781)
1212* Not create two sessions by default in CQLEngine (PYTHON-814)
1313* Bug when subclassing AyncoreConnection (PYTHON-827)
14+ * Error at cleanup when closing the asyncore connections (PYTHON-829)
1415
15163.11.0
1617======
Original file line number Diff line number Diff line change @@ -279,6 +279,9 @@ def _cleanup(self):
279279 if not self ._thread :
280280 return
281281
282+ # The loop shouldn't be woken up from here onwards since it won't be running
283+ self ._loop_dispatcher ._notified = True
284+
282285 log .debug ("Waiting for event loop thread to join..." )
283286 self ._thread .join (timeout = 1.0 )
284287 if self ._thread .is_alive ():
@@ -288,9 +291,12 @@ def _cleanup(self):
288291
289292 log .debug ("Event loop thread was joined" )
290293
291- # Ensure all connections are closed and in-flight requests cancelled
294+ # Ensure all connections are closed and in-flight requests cancelled
292295 for conn in tuple (_dispatcher_map .values ()):
293296 conn .close ()
297+ # The event loop should be closed, so we call remaining asyncore.close
298+ # callbacks from here
299+ self ._timers .service_timeouts ()
294300
295301 log .debug ("Dispatchers were closed" )
296302
You can’t perform that action at this time.
0 commit comments