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

fix: solve the problem of serviceInfo incomparable, to fit the upgrade of grpc-go. #309

Merged
merged 15 commits into from
Apr 19, 2022

Conversation

myoasm
Copy link
Contributor

@myoasm myoasm commented Apr 1, 2022

Describe what this PR does / why we need it

This pr fixes some demos about grpc load balancing based on etcd in example,and it fix one issue.

Does this pull request fix one issue?

Fixes #293

Describe how you did it

Implement the equal method for the serviceInfo structure

Describe how to verify it

This pr opened with a test demo, which can prove my work

Special notes for reviews

@myoasm myoasm closed this Apr 1, 2022
@myoasm myoasm reopened this Apr 1, 2022
@sysulq
Copy link
Member

sysulq commented Apr 1, 2022

需要增加一个复现panic的测试用例

@codecov-commenter
Copy link

codecov-commenter commented Apr 1, 2022

Codecov Report

Merging #309 (a6f7ec2) into master (e0055ad) will decrease coverage by 0.15%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #309      +/-   ##
==========================================
- Coverage   31.74%   31.58%   -0.16%     
==========================================
  Files          93       95       +2     
  Lines        6528     6588      +60     
==========================================
+ Hits         2072     2081       +9     
- Misses       4321     4372      +51     
  Partials      135      135              
Impacted Files Coverage Δ
pkg/server/server.go 13.46% <100.00%> (ø)
pkg/store/gorm/init.go 30.76% <0.00%> (-11.54%) ⬇️
pkg/server/init.go 62.50% <0.00%> (ø)

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 e0055ad...a6f7ec2. Read the comment docs.

@sysulq
Copy link
Member

sysulq commented Apr 1, 2022

需要解决下lint问题

@myoasm myoasm closed this Apr 2, 2022
@myoasm myoasm reopened this Apr 2, 2022
@sysulq sysulq self-requested a review April 11, 2022 07:59
// comparison at runtime results in panic
func TestNotImplementEqual(t *testing.T) {

defer func() {
Copy link
Member

Choose a reason for hiding this comment

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

We should use assert.Panics with https://github.com/stretchr/testify

helloworld.UnimplementedGreeterServer

type Greeter struct{
helloworld.GreeterServer
Copy link
Member

Choose a reason for hiding this comment

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

这里还是用helloworld.UnimplementedGreeterServer更好

helloworld.UnimplementedGreeterServer

type Greeter struct{
helloworld.GreeterServer
Copy link
Member

Choose a reason for hiding this comment

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

这里还是用helloworld.UnimplementedGreeterServer更好

@@ -54,7 +54,7 @@ func (eng *Engine) serveGRPC() error {
}

type Greeter struct {
helloworld.UnimplementedGreeterServer
helloworld.GreeterServer
Copy link
Member

Choose a reason for hiding this comment

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

同上

@@ -54,7 +54,7 @@ func (eng *Engine) serveGRPC() error {
}

type Greeter struct {
helloworld.UnimplementedGreeterServer
helloworld.GreeterServer
Copy link
Member

Choose a reason for hiding this comment

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

同上

@sysulq sysulq merged commit 77f6f92 into douyu:master Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG]使用balance:grpc.round_robin或jupiter.p2c,使用服务发现必然出现panic问题
3 participants