mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-08-27 12:30:13 +03:00
Fix: Check compute connectivity before node creation in open()
When opening a closed project with nodes on an offline remote compute, open() would block for 120s trying to connect before eventually failing. Now checks compute connectivity after loading the topology file but before creating nodes, allowing immediate failure with a clear error message. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
30ebde0cb0
commit
f1b11e7cae
@ -1184,6 +1184,16 @@ class Project:
|
||||
if compute_id not in self._computes:
|
||||
self._computes.append(compute_id)
|
||||
|
||||
# Check compute connectivity before creating nodes to avoid
|
||||
# 120-second timeout when a remote compute is unreachable
|
||||
disconnected = self._get_disconnected_computes()
|
||||
if disconnected:
|
||||
compute_names = ", ".join([f"'{c.name}'" for c in disconnected])
|
||||
raise ControllerError(
|
||||
f"Cannot open project '{self.name}': {len(disconnected)} compute(s) are disconnected: {compute_names}. "
|
||||
f"Please check the connection and try again."
|
||||
)
|
||||
|
||||
for node in topology.get("nodes", []):
|
||||
compute = self.controller.get_compute(node.pop("compute_id"))
|
||||
name = node.pop("name")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user