Commit 9925e7d0 authored by Julien Prigent's avatar Julien Prigent Committed by oroulet

When disconnecting the client, we have to cancel the uaclient _publish_task.

If we don't, this can prevent reconnection since the task is still running, and the previous task instance could be hanging on a previous request that has never completed (i.e network issue).

Yes, there's no timeout on request coming from the publish_loop, so we
must ensure the publish_task is always cancelled. Hence, the
uaclient.close_session is always called on disconnect.
parent ba006abd
......@@ -517,7 +517,10 @@ class Client:
Close session
"""
self._renew_channel_task.cancel()
await self._renew_channel_task
try:
await self._renew_channel_task
except Exception:
_logger.exception("Error while closing secure channel loop")
return await self.uaclient.close_session(True)
def get_root_node(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment