Corrected memory leak of task refs in client deliver_message on timeout causing client_tasks to grow forever, in plugin/manager causing _fired_events to grow forever

pull/5/head
shipmints 2020-02-14 20:36:17 -05:00
rodzic f81de68aed
commit 138313a3eb
2 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -358,6 +358,7 @@ class MQTTClient:
else:
#timeout occured before message received
deliver_task.cancel()
self.client_tasks.pop()
raise asyncio.TimeoutError
@asyncio.coroutine

Wyświetl plik

@ -136,7 +136,7 @@ class PluginManager:
def clean_fired_events(future):
try:
self._fired_events.remove(task)
self._fired_events.remove(future)
except (KeyError, ValueError):
pass
@ -149,6 +149,7 @@ class PluginManager:
if wait:
if tasks:
yield from asyncio.wait(tasks, loop=self._loop)
self.logger.debug("Plugins len(_fired_events)=%d" % (len(self._fired_events)))
@asyncio.coroutine
def map(self, coro, *args, **kwargs):