From 6870749e5036e89c1395380c6095734e987f21a1 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Fri, 5 May 2017 19:39:06 +0200 Subject: [PATCH] Handle a race condition at project closing Fix #1015 --- gns3server/handlers/api/compute/project_handler.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gns3server/handlers/api/compute/project_handler.py b/gns3server/handlers/api/compute/project_handler.py index 77a9e8d6..3c6541e6 100644 --- a/gns3server/handlers/api/compute/project_handler.py +++ b/gns3server/handlers/api/compute/project_handler.py @@ -112,7 +112,10 @@ class ProjectHandler: if ProjectHandler._notifications_listening.setdefault(project.id, 0) <= 1: yield from project.close() pm.remove_project(project.id) - del ProjectHandler._notifications_listening[project.id] + try: + del ProjectHandler._notifications_listening[project.id] + except KeyError: + pass else: log.warning("Skip project closing, another client is listening for project notifications") response.set_status(204)