-
Notifications
You must be signed in to change notification settings - Fork 78
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
bugfix remove unneccessary error return & add grpc status code handling for backoff #1253
Conversation
…ng for backoff Signed-off-by: kpango <[email protected]>
[CHATOPS:HELP] ChatOps commands.
|
if !ok { | ||
return nil, err != nil, err | ||
} | ||
switch st.Code() { |
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.
🚫 [golangci] reported by reviewdog 🐶
missing cases in switch of type codes.Code: Aborted, AlreadyExists, Canceled, DataLoss, DeadlineExceeded, FailedPrecondition, InvalidArgument, NotFound, OK, OutOfRange, PermissionDenied, Unauthenticated, Unimplemented, Unknown (exhaustive)
if !ok { | ||
return nil, err != nil, err | ||
} | ||
switch st.Code() { |
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.
🚫 [golangci] reported by reviewdog 🐶
missing cases in switch of type codes.Code: Aborted, AlreadyExists, Canceled, DataLoss, DeadlineExceeded, FailedPrecondition, InvalidArgument, NotFound, OK, OutOfRange, PermissionDenied, Unauthenticated, Unimplemented, Unknown (exhaustive)
Codecov Report
@@ Coverage Diff @@
## master #1253 +/- ##
==========================================
- Coverage 18.05% 17.47% -0.58%
==========================================
Files 501 498 -3
Lines 31198 30948 -250
==========================================
- Hits 5633 5409 -224
+ Misses 25266 25261 -5
+ Partials 299 278 -21
Continue to review full report at Codecov.
|
Signed-off-by: kpango <[email protected]>
Signed-off-by: kpango <[email protected]>
Signed-off-by: kpango <[email protected]>
} | ||
} | ||
} | ||
return rerr | ||
} | ||
|
||
func (g *gRPCClient) OrderedRangeConcurrent(ctx context.Context, | ||
orders []string, concurrency int, f func(ctx context.Context, addr string, conn *ClientConn, copts ...CallOption) error) (err error) { | ||
orders []string, concurrency int, f func(ctx context.Context, addr string, conn *ClientConn, copts ...CallOption) error) (rerr error) { |
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.
🚫 [golangci] reported by reviewdog 🐶
line is 136 characters (lll)
@@ -386,15 +414,20 @@ func (g *gRPCClient) OrderedRange(ctx context.Context, | |||
return nil, f(ictx, addr, conn, copts...) | |||
}) | |||
if err != nil { | |||
rerr = errors.Wrap(rerr, errors.ErrRPCCallFailed(addr, err).Error()) | |||
err = errors.ErrRPCCallFailed(addr, err) | |||
if rerr == nil { |
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.
🚫 [golangci] reported by reviewdog 🐶
if statements should only be cuddled with assignments used in the if statement itself (wsl)
Signed-off-by: kpango <[email protected]>
Signed-off-by: kpango <[email protected]>
pkg/gateway/lb/service/gateway.go
Outdated
@@ -103,11 +110,30 @@ func (g *gateway) DoMulti(ctx context.Context, num int, | |||
return err | |||
} | |||
atomic.AddUint32(&cur, 1) | |||
visited.Store(addr, struct{}{}) | |||
} | |||
return nil | |||
}) | |||
if err != nil && cur < limit { |
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.
🚫 [golangci] reported by reviewdog 🐶if err != nil && cur < limit
is deeply nested (complexity: 7) (nestif)
} | ||
return nil | ||
}) | ||
if err != nil && cur < limit { | ||
return err | ||
if err != nil || cur < limit { |
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.
🚫 [golangci] reported by reviewdog 🐶if err != nil || cur < limit
is deeply nested (complexity: 7) (nestif)
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
Signed-off-by: kpango [email protected]
Description:
bugfix remove unneccessary error return
add grpc status code handling for backoff
Related Issue:
How Has This Been Tested?:
Environment:
Types of changes:
Changes to Core Features:
Checklist: