-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Release v0.27.5 #2324
Release v0.27.5 #2324
Conversation
* Dedup addresses to dial Co-authored-by: Aayush Rajasekaran <[email protected]> * Move DedupAddrs test * Typo --------- Co-authored-by: Aayush Rajasekaran <[email protected]>
Suggested version: Changes in (empty)
Cutting a Release (when not on
|
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. Should this be a PR targeting master though (without the version change, obviously), and then be cherry picked onto the release branch?
@@ -184,3 +186,23 @@ type Dialer interface { | |||
Notify(Notifiee) | |||
StopNotify(Notifiee) | |||
} | |||
|
|||
// DedupAddrs deduplicates addresses in place, leave only unique addresses. |
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.
// DedupAddrs deduplicates addresses in place, leave only unique addresses. | |
// DedupAddrs deduplicates addresses in place, leaving only unique addresses. |
t.Run(fmt.Sprintf("test %d", i), func(t *testing.T) { | ||
deduped := DedupAddrs(tc.in) | ||
for _, a := range tc.out { | ||
require.Contains(t, deduped, a) |
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.
You also need to check the length, otherwise deduped
could still contain duplicates.
ad := w.pending[string(addr.Bytes())] | ||
ad, ok := w.pending[string(addr.Bytes())] | ||
if !ok { | ||
log.Warn("unexpectedly missing pending addrDial for addr") |
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.
log.Warn("unexpectedly missing pending addrDial for addr") | |
log.Errorf("swarm dial worker BUG: unexpectedly missing pending addrDial for addr: %s", addr) |
ad := w.pending[string(res.Addr.Bytes())] | ||
ad, ok := w.pending[string(res.Addr.Bytes())] | ||
if !ok { | ||
log.Warn("unexpectedly missing pending addrDial res") |
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.
Same here?
New patch release to avoid a panic in edge cases in the dial worker code.