Skip to content

feat(discovery): add jitter and fix backoff #2967

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

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

nodersteam
Copy link
Contributor

  • Replacing time.NewTicker with time.NewTimer
  • Adding backoff logic
  • Adding jitter to backoff
  • Removed unused test variable

@github-actions github-actions bot added the external Issues created by non node team members label Nov 27, 2023
@ramin ramin added area:p2p kind:feat Attached to feature PRs labels Nov 28, 2023
@nodersteam
Copy link
Contributor Author

Is it acceptable to use math/rand or add generation logic via crypto/rand to fix Lint?

@nodersteam nodersteam requested a review from ramin as a code owner December 7, 2023 02:40
@nodersteam
Copy link
Contributor Author

@Wondertan Could you please check this PR?
Or is it possible to point out more important issues at the moment if this PR is not of value at the moment?

@Wondertan
Copy link
Member

Hey @nodersteam, I am deferring the review of this to @walldiss, as the most prominent expert on that code.

@nodersteam
Copy link
Contributor Author

Hey @nodersteam, I am deferring the review of this to @walldiss, as the most prominent expert on that code.

Got it! Thx

@nodersteam nodersteam requested a review from cristaloleg as a code owner May 27, 2024 04:03
@cristaloleg cristaloleg changed the title feat(discovery): add jiter and fix backoff feat(discovery): add jitter and fix backoff May 27, 2024
"time"

"golang.org/x/sync/errgroup"
Copy link
Contributor

Choose a reason for hiding this comment

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

Better to keep as it was.

discoveryRetryTimeout = time.Millisecond * 100 // defined in discovery.go

ctx, cancel := context.WithTimeout(context.Background(), time.Second*20)
ctx, cancel := context.WithTimeout(context.Background(), time.Minute*10)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why so big? 30x more than before 👀

continue
}
d.backoffDuration = backoffInitialDuration
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we also reset backoffTimer here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:p2p external Issues created by non node team members kind:feat Attached to feature PRs needs:triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants