mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-08-27 12:30:13 +03:00
fix: Handle connection errors when stopping node console
Add exception handling in stop_wrap_console to gracefully handle ConnectionResetError, BrokenPipeError, and OSError when waiting for console writer to close. This prevents 500 errors when stopping QEMU nodes if the console connection is reset before the writer finishes closing. Fixes race condition where QEMU process exits and closes connections before the console writer cleanup completes.
This commit is contained in:
parent
e0860555ba
commit
3752b2bac8
@ -474,10 +474,18 @@ class BaseNode:
|
||||
|
||||
if self._wrap_console_writer:
|
||||
self._wrap_console_writer.close()
|
||||
await self._wrap_console_writer.wait_closed()
|
||||
try:
|
||||
await self._wrap_console_writer.wait_closed()
|
||||
except (ConnectionResetError, BrokenPipeError, OSError):
|
||||
# Connection already closed, ignore error
|
||||
pass
|
||||
for telnet_proxy_server in self._wrapper_telnet_servers:
|
||||
telnet_proxy_server.close()
|
||||
await telnet_proxy_server.wait_closed()
|
||||
try:
|
||||
await telnet_proxy_server.wait_closed()
|
||||
except (ConnectionResetError, BrokenPipeError, OSError):
|
||||
# Connection already closed, ignore error
|
||||
pass
|
||||
self._wrapper_telnet_servers = []
|
||||
|
||||
async def reset_wrap_console(self):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user