mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-01-31 13:23:48 +02:00
Catch more error to avoid dead lock at project close
This commit is contained in:
parent
96f3cb0445
commit
919355abd8
@ -347,7 +347,7 @@ class Compute:
|
|||||||
if not self._connected and not self._closed:
|
if not self._connected and not self._closed:
|
||||||
try:
|
try:
|
||||||
response = yield from self._run_http_query("GET", "/capabilities")
|
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
|
# Try to reconnect after 2 seconds if server unavailable
|
||||||
asyncio.get_event_loop().call_later(2, lambda: asyncio.async(self.connect()))
|
asyncio.get_event_loop().call_later(2, lambda: asyncio.async(self.connect()))
|
||||||
return
|
return
|
||||||
|
@ -342,7 +342,7 @@ class Node:
|
|||||||
try:
|
try:
|
||||||
yield from self.post("/stop")
|
yield from self.post("/stop")
|
||||||
# We don't care if a compute is down at this step
|
# 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
|
pass
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
|
@ -497,7 +497,7 @@ class Project:
|
|||||||
try:
|
try:
|
||||||
yield from compute.post("/projects/{}/close".format(self._id))
|
yield from compute.post("/projects/{}/close".format(self._id))
|
||||||
# We don't care if a compute is down at this step
|
# 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
|
pass
|
||||||
self._cleanPictures()
|
self._cleanPictures()
|
||||||
self._status = "closed"
|
self._status = "closed"
|
||||||
|
Loading…
Reference in New Issue
Block a user