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

sciond: Change refresh mechanism to be safer #3434

Merged
merged 2 commits into from
Nov 28, 2019

Conversation

lukedirtwalker
Copy link
Collaborator

@lukedirtwalker lukedirtwalker commented Nov 27, 2019

Instead of deleting next query entries, just always request at the PS.
This can prevent a weird interaction between concurrent requests, which would lead to 0 cached paths.

Marked as breaking because the behavior changes, i.e., sciond no longer deletes anything in the DB on the refresh flag.

Fixes #2871
Fixes #3416


This change is Reviewable

@lukedirtwalker lukedirtwalker requested a review from scrye November 27, 2019 14:14
@lukedirtwalker lukedirtwalker force-pushed the pubSciondConcurrent branch 2 times, most recently from 871a928 to 49d14e1 Compare November 27, 2019 16:07
Copy link
Contributor

@scrye scrye left a comment

Choose a reason for hiding this comment

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

Reviewed 8 of 8 files at r1.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @lukedirtwalker)

a discussion (no related file):
Should we mark this as a Breaking Change? While the behavior is similar to what applications using the Refresh flag expect, it's still a behavior change.



go/lib/infra/modules/segfetcher/resolver.go, line 333 at r1 (raw file):

		return false, err
	}
	return len(segs) == 0 && filtered > 0, nil

I'm missing something here, and it's probably due to my lack of familiarity with the code.

Reading this function, if len(segs) == 0, it means the slice is empty. Therefore, counting what is getting filtered out of should always return 0? In what scenario is this expected to evaluate to true?

@lukedirtwalker lukedirtwalker added the i/breaking change PR that breaks forwards or backwards compatibility label Nov 28, 2019
Copy link
Collaborator Author

@lukedirtwalker lukedirtwalker left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @scrye)

a discussion (no related file):

Previously, scrye (Sergiu Costea) wrote…

Should we mark this as a Breaking Change? While the behavior is similar to what applications using the Refresh flag expect, it's still a behavior change.

We can yes. Also updated the comment.



go/lib/infra/modules/segfetcher/resolver.go, line 333 at r1 (raw file):

segs.FilterSegsErr

modifies the slice inplace

Instead of deleting next query entries, just always request at the PS.
This can prevent a weird interaction between concurrent requests, which would lead to 0 cached paths.

Fixes scionproto#2871
Fixes scionproto#3416
Copy link
Contributor

@scrye scrye left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved


go/lib/infra/modules/segfetcher/resolver.go, line 333 at r1 (raw file):

Previously, lukedirtwalker (Lukas Vogel) wrote…
segs.FilterSegsErr

modifies the slice inplace

Ah, gotcha.

@lukedirtwalker lukedirtwalker merged commit 3ed3032 into scionproto:master Nov 28, 2019
@lukedirtwalker lukedirtwalker deleted the pubSciondConcurrent branch November 28, 2019 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i/breaking change PR that breaks forwards or backwards compatibility
Projects
None yet
2 participants