-
Notifications
You must be signed in to change notification settings - Fork 163
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
Simplify SCIOND client API implementation #3244
Simplify SCIOND client API implementation #3244
Conversation
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 3 of 3 files at r1.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @scrye)
go/lib/sciond/sciond.go, line 48 at r1 (raw file):
U
usually we start error messages with lower case. https://github.com/golang/go/wiki/CodeReviewComments#error-strings
go/lib/sciond/sciond.go, line 82 at r1 (raw file):
_ bool
why not just remove it already?
go/lib/sciond/sciond.go, line 141 at r1 (raw file):
if initialCheckTimeout != 0 { deadline := time.Now().Add(initialCheckTimeout) deadlineCtx, cancelF := context.WithDeadline(context.Background(), deadline)
wait why not just use context.WithTimeout
since you get a timeout?
go/lib/sciond/sciond.go, line 148 at r1 (raw file):
dispatcher, err := c.ctxAwareConnect(ctx) if err != nil { return serrors.WrapStr("Unable to connect to SCIOND", err)
ditto lower case
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: 2 of 7 files reviewed, 4 unresolved discussions (waiting on @lukedirtwalker and @scrye)
go/lib/sciond/sciond.go, line 48 at r1 (raw file):
Previously, lukedirtwalker (Lukas Vogel) wrote…
U
usually we start error messages with lower case. https://github.com/golang/go/wiki/CodeReviewComments#error-strings
Done.
go/lib/sciond/sciond.go, line 82 at r1 (raw file):
Previously, lukedirtwalker (Lukas Vogel) wrote…
_ bool
why not just remove it already?
Forgot about it. Fixed.
go/lib/sciond/sciond.go, line 141 at r1 (raw file):
Previously, lukedirtwalker (Lukas Vogel) wrote…
wait why not just use
context.WithTimeout
since you get a timeout?
Ah, it used to be lower in the function after some of the timeout was used up already, so an absolute deadline was simpler.
Now it no longer makes sense; fixed.
go/lib/sciond/sciond.go, line 148 at r1 (raw file):
Previously, lukedirtwalker (Lukas Vogel) wrote…
ditto lower case
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 5 of 5 files at r2.
Reviewable status: complete! all files reviewed, all discussions resolved
Specifically: - remove the SCIOND client API caching layer; it had a low impact on performance for the code complexity it added; - applications were using the "reconnecting" implementation of the client API; now that is the only available implementation; - migrate to serrors; - remove locking since now calls are independent;
Specifically:
performance for the code complexity it added;
client API; now that is the only available implementation;
This change is