[object Object]

← back to Exo

update visited with self.id, timeout on collecting topology from a peer 5s

80c48b9e7650280ae451be948023ec193ac7c39e · 2024-09-04 15:48:06 +0100 · Alex Cheema

Files touched

Diff

commit 80c48b9e7650280ae451be948023ec193ac7c39e
Author: Alex Cheema <alexcheema123@gmail.com>
Date:   Wed Sep 4 15:48:06 2024 +0100

    update visited with self.id, timeout on collecting topology from a peer 5s
---
 exo/orchestration/standard_node.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/exo/orchestration/standard_node.py b/exo/orchestration/standard_node.py
index b2426a1e..5f76d658 100644
--- a/exo/orchestration/standard_node.py
+++ b/exo/orchestration/standard_node.py
@@ -343,7 +343,7 @@ class StandardNode(Node):
     if DEBUG >= 2: print(f"Collecting topology {max_depth=} {visited=}")
 
     prev_visited = visited.copy()
-    # TODO: should we add our own peer id here?
+    visited.update(self.id)
     visited.update(p.id() for p in self.peers)
 
     for peer in self.peers:
@@ -358,7 +358,7 @@ class StandardNode(Node):
         continue
 
       try:
-        other_topology = await peer.collect_topology(visited, max_depth=max_depth - 1)
+        other_topology = await asyncio.wait_for(peer.collect_topology(visited, max_depth=max_depth - 1), timeout=5.0)
         if DEBUG >= 2: print(f"Collected topology from: {peer.id()}: {other_topology}")
         self.topology.merge(other_topology)
       except Exception as e:

← 355c5799 more robust discovery / peer handling. now we track if the s  ·  back to Exo  ·  add id to set c97da548 →