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

autorelay: poll for new candidates when needed #1587

Merged
merged 11 commits into from
Aug 9, 2022

Conversation

marten-seemann
Copy link
Contributor

@marten-seemann marten-seemann commented Jun 1, 2022

Fixes #1569. Fixes #1440. Closes #1577.

Unblocks #1576 and #1615.

@marten-seemann marten-seemann requested a review from vyzo June 1, 2022 18:51
Copy link
Contributor

@vyzo vyzo left a comment

Choose a reason for hiding this comment

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

strictly an improvement i would say, but see comment for potential little bug.

p2p/host/autorelay/relay_finder.go Outdated Show resolved Hide resolved
vyzo
vyzo previously approved these changes Jun 2, 2022
@marten-seemann marten-seemann force-pushed the autorelay-polling branch 3 times, most recently from 7a53fe0 to 82ab155 Compare June 2, 2022 17:14
@marten-seemann marten-seemann force-pushed the autorelay-polling branch 7 times, most recently from 7803f0b to 23fb7e1 Compare June 24, 2022 11:10
@marten-seemann marten-seemann force-pushed the autorelay-polling branch 7 times, most recently from 72feedb to f4f0b22 Compare June 25, 2022 17:02
@marten-seemann
Copy link
Contributor Author

I rewrote this PR: We now don't keep candidates that we fail to connect to, we throw them out immediately. The application may return them to use on subsequent calls of PeerSource, and we apply a backoff to make sure we don't connect to a node too frequently.

This should now resolve all the flaky autorelay tests.

Copy link
Collaborator

@MarcoPolo MarcoPolo left a comment

Choose a reason for hiding this comment

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

Looks good, just a couple nits. I wonder how flaky these tests will be. At least we aren't relying on a real clock anymore!

p2p/host/autorelay/relay_finder.go Show resolved Hide resolved
p2p/host/autorelay/relay_finder.go Outdated Show resolved Hide resolved
p2p/host/autorelay/timer.go Show resolved Hide resolved
p2p/host/autorelay/timer.go Show resolved Hide resolved
@marten-seemann
Copy link
Contributor Author

All suggestions applied. Re-requesting a review, @vyzo and @MarcoPolo 🙏

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.

make AutoRelay ask the application for new candidates autorelay: flaky TestSingleRelay
3 participants