1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-12-01 04:38:12 +00:00

Do not raise exception if Dynamips or uBridge hypervisor don't return data and are still running. Fixes #1289

This commit is contained in:
grossmj 2018-03-07 19:11:34 +07:00
parent 3ca4f72b99
commit a3a0657502
2 changed files with 12 additions and 0 deletions

View File

@ -276,6 +276,9 @@ class DynamipsHypervisor:
log.warning("Connection reset received while reading Dynamips response: {}".format(e)) log.warning("Connection reset received while reading Dynamips response: {}".format(e))
continue continue
if not chunk: if not chunk:
if self.is_running():
log.warning("No data returned from {host}:{port}".format(host=self._host, port=self._port))
continue
raise DynamipsError("No data returned from {host}:{port}, Dynamips process running: {run}" raise DynamipsError("No data returned from {host}:{port}, Dynamips process running: {run}"
.format(host=self._host, port=self._port, run=self.is_running())) .format(host=self._host, port=self._port, run=self.is_running()))
buf += chunk.decode("utf-8", errors="ignore") buf += chunk.decode("utf-8", errors="ignore")

View File

@ -222,7 +222,16 @@ class UBridgeHypervisor:
# task has been canceled but continue to read # task has been canceled but continue to read
# any remaining data sent by the hypervisor # any remaining data sent by the hypervisor
continue continue
except ConnectionResetError as e:
# Sometimes WinError 64 (ERROR_NETNAME_DELETED) is returned here on Windows.
# These happen if connection reset is received before IOCP could complete
# a previous operation. Ignore and try again....
log.warning("Connection reset received while reading uBridge response: {}".format(e))
continue
if not chunk: if not chunk:
if self.is_running():
log.warning("No data returned from {host}:{port}".format(host=self._host, port=self._port))
continue
raise UbridgeError("No data returned from {host}:{port}, uBridge process running: {run}" raise UbridgeError("No data returned from {host}:{port}, uBridge process running: {run}"
.format(host=self._host, port=self._port, run=self.is_running())) .format(host=self._host, port=self._port, run=self.is_running()))
buf += chunk.decode("utf-8") buf += chunk.decode("utf-8")