-
Notifications
You must be signed in to change notification settings - Fork 44
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
appnet: filter duplicate paths in QueryPaths #161
Conversation
Filter paths with identical sequence of interfaces. These duplicates occur because sciond may return the same "effective" path with different short-cut "upstream" parts. We don't need these duplicates, they are identical for our purposes; we simply pick the one with latest expiry. See also discussion in scionproto/scion#2445 (currently not merged).
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.
just a small nit.
Reviewed 1 of 1 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @FR4NK-W and @matzf)
pkg/appnet/path_selection.go, line 127 at r1 (raw file):
func filterDuplicates(paths []snet.Path) []snet.Path { set := make(map[snet.PathFingerprint]int)
I would rename set
to something like chosenPath
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.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @FR4NK-W and @juagargi)
pkg/appnet/path_selection.go, line 127 at r1 (raw file):
Previously, juagargi (Juan A. Garcia Pardo) wrote…
I would rename
set
to something likechosenPath
Done.
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.
Reviewed 1 of 1 files at r2.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @FR4NK-W)
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.
Reviewable status: complete! all files reviewed, all discussions resolved
pkg/appnet/path_selection.go, line 137 at r1 (raw file):
kept := make(map[int]struct{})
Ok with me, but wouldn't it have been easier to keep a slice of indices you want to keep and sort that in ascending order (to preserve the initial order)?
Filter paths with identical sequence of interfaces. These duplicates
occur because sciond may return the same "effective" path with different
short-cut "upstream" parts. We don't need these duplicates, the paths are
identical for our purposes; we simply pick the one with latest expiry.
See also discussion in scionproto/scion#2445 (currently not merged).
This change is