From bfbc6ff0bec62e2ba7945c44f4caac8b6be01762 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Tue, 31 Jan 2017 13:43:05 +0100 Subject: [PATCH] Fix rare race condition when stopping ubridge Fix #887 --- gns3server/utils/asyncio/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gns3server/utils/asyncio/__init__.py b/gns3server/utils/asyncio/__init__.py index 524903ad..2046f6a6 100644 --- a/gns3server/utils/asyncio/__init__.py +++ b/gns3server/utils/asyncio/__init__.py @@ -77,8 +77,11 @@ def wait_for_process_termination(process, timeout=10): :param timeout: Timeout in seconds """ - if sys.version_info >= (3,5): - yield from asyncio.wait_for(process.wait(), timeout=timeout) + if sys.version_info >= (3, 5): + try: + yield from asyncio.wait_for(process.wait(), timeout=timeout) + except ProcessLookupError: + return else: while timeout > 0: if process.returncode is not None: