summaryrefslogtreecommitdiff
path: root/kvmd/apps
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2019-06-08 04:15:20 +0300
committerDevaev Maxim <[email protected]>2019-06-08 04:15:20 +0300
commit77a749873119252dec64245e3a3de9c08bd6cd2f (patch)
treeec46a3b2c0202626e2d0d10291271b2eddd5ee9f /kvmd/apps
parent445f2f9e63fb71cd6f9d721817a1d72dc761ff35 (diff)
process CancelledError
Diffstat (limited to 'kvmd/apps')
-rw-r--r--kvmd/apps/kvmd/server.py4
-rw-r--r--kvmd/apps/kvmd/streamer.py2
2 files changed, 6 insertions, 0 deletions
diff --git a/kvmd/apps/kvmd/server.py b/kvmd/apps/kvmd/server.py
index 67207152..16af2d9c 100644
--- a/kvmd/apps/kvmd/server.py
+++ b/kvmd/apps/kvmd/server.py
@@ -574,6 +574,8 @@ class Server: # pylint: disable=too-many-instance-attributes
logger.info("Cleaning up %s ...", type(obj).__name__)
try:
await obj.cleanup() # type: ignore
+ except asyncio.CancelledError: # pylint: disable=try-except-raise
+ raise
except Exception:
logger.exception("Cleanup error")
@@ -605,6 +607,8 @@ class Server: # pylint: disable=too-many-instance-attributes
remote: Optional[str] = (ws._req.remote if ws._req is not None else None) # pylint: disable=protected-access
get_logger().info("Removed client socket: remote=%s; id=%d; active=%d", remote, id(ws), len(self.__sockets))
await ws.close()
+ except asyncio.CancelledError: # pylint: disable=try-except-raise
+ raise
except Exception:
pass
diff --git a/kvmd/apps/kvmd/streamer.py b/kvmd/apps/kvmd/streamer.py
index 4afc018c..ff0d92f0 100644
--- a/kvmd/apps/kvmd/streamer.py
+++ b/kvmd/apps/kvmd/streamer.py
@@ -128,6 +128,8 @@ class Streamer: # pylint: disable=too-many-instance-attributes
state = (await response.json())["result"]
except (aiohttp.ClientConnectionError, aiohttp.ServerConnectionError):
pass
+ except asyncio.CancelledError: # pylint: disable=try-except-raise
+ raise
except Exception:
get_logger().exception("Invalid streamer response from /state")
return {