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

Prepare balancer interfaces for >=google.golang.org/grpc@1.30.0 upgrade. #12658

Merged
merged 1 commit into from
Feb 2, 2021

Conversation

dhermes
Copy link
Contributor

@dhermes dhermes commented Feb 1, 2021

No description provided.

@@ -191,6 +214,13 @@ func (bb *baseBalancer) HandleResolvedAddrs(addrs []resolver.Address, err error)
// (DO NOT) delete(bb.scToSt, sc)
}
}

return nil
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ptabor I think we could do better here than a nil. For example, every time there is a

			if err != nil {
				bb.lg.Warn("NewSubConn failed", zap.String("picker", bb.picker.String()), zap.String("balancer-id", bb.id), zap.Error(err), zap.String("address", addr.Addr))
				continue
			}

above we could append the err to a slice and then coalesce that slice here into a non-nil return if desired.

(An early exit after the bb.lg.Warn() would be a breaking change so coalescing would be the safe way to do it.)

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree. We should both log them and collect.

As long as we don't wrap them into ErrBadResolverState it should have not semantic impact.

Mid-term: I would consider throwing ErrBadResolverState in case there is no SubConn resolved, but this requires separate testing. Maybe worth adding a TODO.

@codecov-io
Copy link

Codecov Report

Merging #12658 (fec2ca9) into master (b5d1172) will increase coverage by 11.63%.
The diff coverage is 30.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #12658       +/-   ##
===========================================
+ Coverage   51.78%   63.42%   +11.63%     
===========================================
  Files         409      406        -3     
  Lines       32671    32579       -92     
===========================================
+ Hits        16919    20662     +3743     
+ Misses      13756     9800     -3956     
- Partials     1996     2117      +121     
Flag Coverage Δ
all 63.42% <30.00%> (+11.63%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
client/v3/balancer/picker/err.go 75.00% <0.00%> (-25.00%) ⬇️
client/v3/balancer/picker/roundrobin_balanced.go 92.68% <0.00%> (-2.06%) ⬇️
client/v3/balancer/balancer.go 84.37% <50.00%> (+6.32%) ⬆️
server/etcdserver/api/v2v3/watcher.go 0.00% <0.00%> (-82.09%) ⬇️
client/v3/balancer/utils.go 50.00% <0.00%> (-50.00%) ⬇️
server/etcdserver/api/v2v3/store.go 30.60% <0.00%> (-47.76%) ⬇️
client/v2/members.go 43.39% <0.00%> (-41.51%) ⬇️
client/v2/client.go 42.06% <0.00%> (-38.75%) ⬇️
client/v3/compact_op.go 66.66% <0.00%> (-33.34%) ⬇️
client/v3/namespace/util.go 66.66% <0.00%> (-33.34%) ⬇️
... and 173 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b5d1172...fec2ca9. Read the comment docs.

@@ -191,6 +214,13 @@ func (bb *baseBalancer) HandleResolvedAddrs(addrs []resolver.Address, err error)
// (DO NOT) delete(bb.scToSt, sc)
}
}

return nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Agree. We should both log them and collect.

As long as we don't wrap them into ErrBadResolverState it should have not semantic impact.

Mid-term: I would consider throwing ErrBadResolverState in case there is no SubConn resolved, but this requires separate testing. Maybe worth adding a TODO.

@ptabor
Copy link
Contributor

ptabor commented Feb 2, 2021

Thank you. Hopefully final request: Could you please 'git squash' it into a single commit.

If I 'squashed and merge', your authorship would not be preserved.

@dhermes
Copy link
Contributor Author

dhermes commented Feb 2, 2021

Sure thing, I presume you want me to rebase too.

I am going to rebase, but for posterity the current merge-base is b5d1172 and the current HEAD is 56148fb.

@dhermes
Copy link
Contributor Author

dhermes commented Feb 2, 2021

Forgot to commit my branch after merge --squash and pushed HEAD in master, which caused GitHub to close my PR! Should be all good though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants