From 919355abd8d23c7b1a129b7aef1ceed5566d77c0 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Mon, 29 Aug 2016 18:59:13 +0200 Subject: [PATCH] Catch more error to avoid dead lock at project close --- gns3server/controller/compute.py | 2 +- gns3server/controller/node.py | 2 +- gns3server/controller/project.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gns3server/controller/compute.py b/gns3server/controller/compute.py index 33dac0ab..5be1d6d8 100644 --- a/gns3server/controller/compute.py +++ b/gns3server/controller/compute.py @@ -347,7 +347,7 @@ class Compute: if not self._connected and not self._closed: try: response = yield from self._run_http_query("GET", "/capabilities") - except (aiohttp.errors.ClientOSError, aiohttp.errors.ClientRequestError): + except (aiohttp.errors.ClientOSError, aiohttp.errors.ClientRequestError, aiohttp.ClientResponseError): # Try to reconnect after 2 seconds if server unavailable asyncio.get_event_loop().call_later(2, lambda: asyncio.async(self.connect())) return diff --git a/gns3server/controller/node.py b/gns3server/controller/node.py index 8f797526..baa68c06 100644 --- a/gns3server/controller/node.py +++ b/gns3server/controller/node.py @@ -342,7 +342,7 @@ class Node: try: yield from self.post("/stop") # We don't care if a compute is down at this step - except aiohttp.errors.ClientOSError: + except (aiohttp.errors.ClientOSError, aiohttp.web.HTTPNotFound, aiohttp.web.HTTPConflict): pass @asyncio.coroutine diff --git a/gns3server/controller/project.py b/gns3server/controller/project.py index d1ce7e34..90130283 100644 --- a/gns3server/controller/project.py +++ b/gns3server/controller/project.py @@ -497,7 +497,7 @@ class Project: try: yield from compute.post("/projects/{}/close".format(self._id)) # We don't care if a compute is down at this step - except aiohttp.errors.ClientOSError: + except (aiohttp.errors.ClientOSError, aiohttp.web.HTTPNotFound, aiohttp.web.HTTPConflict): pass self._cleanPictures() self._status = "closed"