You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the course of debugging it seems to me that the dht bootstrap is starting before the host has connected to the bootstrap peers. Does anyone else see this? In the code below bootstrapRound and n.Routing.Bootstrap() seem to be running at the same time and the dht bootstap logs so failure to bootstrap.
Seems like moving the code block below to right before the dht bootstrap would fix.
doneWithRound <- struct{}{}
close(doneWithRound) // it no longer blocks periodic
func Bootstrap(n *IpfsNode, cfg BootstrapConfig) (io.Closer, error) {
// make a signal to wait for one bootstrap round to complete.
doneWithRound := make(chan struct{})
// the periodic bootstrap function -- the connection supervisor
periodic := func(worker goprocess.Process) {
ctx := procctx.OnClosingContext(worker)
defer log.EventBegin(ctx, "periodicBootstrap", n.Identity).Done()
if err := bootstrapRound(ctx, n.PeerHost, cfg); err != nil {
log.Event(ctx, "bootstrapError", n.Identity, lgbl.Error(err))
log.Debugf("%s bootstrap error: %s", n.Identity, err)
}
<-doneWithRound
}
// kick off the node's periodic bootstrapping
proc := periodicproc.Tick(cfg.Period, periodic)
proc.Go(periodic) // run one right now.
// kick off Routing.Bootstrap
go func() {
if n.Routing != nil {
ctx := procctx.OnClosingContext(proc)
if err := n.Routing.Bootstrap(ctx); err != nil {
proc.Close()
log.Error(err)
}
}
}()
doneWithRound <- struct{}{}
close(doneWithRound) // it no longer blocks periodic
return proc, nil
}
The text was updated successfully, but these errors were encountered:
It's very likely. Currently connection to the bootstrap nodes should occur synchronously before the first bootstrap attempt (which is also not used synchronous at the moment). See the activity in the DHT repo around BootstrapOnce.
In the course of debugging it seems to me that the dht bootstrap is starting before the host has connected to the bootstrap peers. Does anyone else see this? In the code below
bootstrapRound
andn.Routing.Bootstrap()
seem to be running at the same time and the dht bootstap logs so failure to bootstrap.Seems like moving the code block below to right before the dht bootstrap would fix.
The text was updated successfully, but these errors were encountered: