-
Notifications
You must be signed in to change notification settings - Fork 20.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
swarm/network: WIP consider all nodes for healthy iteration #19155
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except for a few code-style comments.
The strange thing about this is that I had a feeling that the AddNodes
and ConnectNodesX
would actually block. Judging by the results of the snapshot it means that both these methods return and potentially before the nodes were even up? This is quite strange. Moreover considering that the Node.Up
is set to be true when creating the node - they should all be up
after create.go#L82
. We should add a panic in Net.ConnectX
when the Up
node count does not equal the parameter value.
@@ -85,6 +86,7 @@ func (s *Simulation) WaitTillHealthy(ctx context.Context) (ill map[enode.ID]*net | |||
// in simulation bucket. | |||
func (s *Simulation) kademlias() (ks map[enode.ID]*network.Kademlia) { | |||
items := s.UpNodesItems(BucketKeyKademlia) | |||
log.Debug("kademlia len items", "len", len(items)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
@holisticode there is a consistent CI failure on snapshot creation |
@@ -76,17 +79,17 @@ func createSnapshot(filename string, nodes int, services []string) (err error) { | |||
}) | |||
defer sim.Close() | |||
|
|||
_, err = sim.AddNodes(nodes) | |||
ids, err := sim.AddNodes(nodes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should just use AddNodesAndConnectRing
here
…#19155) * swarm/network: WIP consider all nodes for healthy iteration * swarm/network/simulation: extend TestWaitTillHealthy to really check kads are healthy * cmd/swarm/swarm-snapshot: fixed bugs in snapshot creation binary * swarm/network/simulation: addressed PR comments * swarm/network/simulation: defer sim.Clsoe() * swarm/network/simulation: fixed wrong sim.Close() * swarm/network/simulation: addressed PR comments * cmd/swarm/swarm-snapshot: reducing default to 8 nodes, more to 4 * cmd/swarm/swarm-snapshot: extended timeout to 3 mins, or 256 nodes snapshot times out * swarm/network/simulation: More PR comments
addresses ethersphere/swarm#1263
This PR corrects two problems with the existing
WaitTillHealthy
implementation.ConnectNN
, should instead callHealthy()