From 8a459a48213073776e98ccdb6e4330f1d1979c10 Mon Sep 17 00:00:00 2001 From: John Fleming <31658656+spikefishjohn@users.noreply.github.com> Date: Tue, 20 Feb 2024 00:46:00 -0500 Subject: [PATCH] Update notification_handler.py Force close websocket tcp socket. --- gns3server/handlers/api/controller/notification_handler.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gns3server/handlers/api/controller/notification_handler.py b/gns3server/handlers/api/controller/notification_handler.py index bf41ad20..9c532e44 100644 --- a/gns3server/handlers/api/controller/notification_handler.py +++ b/gns3server/handlers/api/controller/notification_handler.py @@ -82,6 +82,11 @@ class NotificationHandler: log.info("Client has disconnected from controller WebSocket") if not ws.closed: await ws.close() + try: + # call close to force close ws transport. Unknown root cause as of yet. + ws._req.transport.close() + except: + pass request.app['websockets'].discard(ws) return ws