Skip to content
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

Add delay in initial relay advertisement to allow the dht time to bootstrap #495

Merged
merged 2 commits into from
Dec 5, 2018

Conversation

vyzo
Copy link
Contributor

@vyzo vyzo commented Nov 29, 2018

This came up in libp2p/go-libp2p-discovery#5

Also increases the test autonat identify delay to 500ms to make it less flaky in macos.

@ghost ghost assigned vyzo Nov 29, 2018
@ghost ghost added the status/in-progress In progress label Nov 29, 2018
@vyzo vyzo requested a review from Stebalien November 29, 2018 10:26
@vyzo vyzo mentioned this pull request Dec 4, 2018
8 tasks
@@ -25,7 +30,10 @@ func NewRelayHost(ctx context.Context, bhost *basic.BasicHost, advertise discove
advertise: advertise,
}
bhost.AddrsFactory = h.hostAddrs
discovery.Advertise(ctx, advertise, RelayRendezvous)
go func() {
time.Sleep(AdvertiseBootDelay)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

select {
case <-time.After(AdvertiseBootDelay):
  discovery.Advertise(ctx, advertise, RelayRendezvous)
case <-ctx.Done():
}

@vyzo
Copy link
Contributor Author

vyzo commented Dec 5, 2018

@bigs done.

@vyzo vyzo merged commit e042905 into master Dec 5, 2018
@ghost ghost removed the status/in-progress In progress label Dec 5, 2018
@vyzo vyzo deleted the fix/advertise-relay branch December 5, 2018 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants