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 PolarisServiceWatcher bug and add ZookeeperServiceDiscovery ut #1988

Merged
merged 10 commits into from
Aug 2, 2022
Merged

fix PolarisServiceWatcher bug and add ZookeeperServiceDiscovery ut #1988

merged 10 commits into from
Aug 2, 2022

Conversation

jasondeng1997
Copy link
Member

ConsumerAPI.Subscribe 只需要执行一次,如果 Subscribe,可能是 SDK 内返回了类似 Busy 类的错误,因此需要先保证 ConsumerAPI.Subscribe 一定成功,成功之后,会返回一个用于订阅的 chan,这个chan需要走 for range or for select 的语句不断消费 chan 里面的实例变化事件,如果 chan 被 sdk 内部逻辑 close 的话,那么就又会走到外层的循环进行再次发起订阅动作,如果内部for发生错误,跳出当前for,继续执行监听事件

dependabot bot and others added 2 commits July 21, 2022 14:44
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.47.0 to 1.48.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](grpc/grpc-go@v1.47.0...v1.48.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@jasondeng1997
Copy link
Member Author

@chuntaojun pls review pr

@codecov-commenter
Copy link

codecov-commenter commented Jul 21, 2022

Codecov Report

Merging #1988 (62dc162) into 3.0 (98e3c7a) will increase coverage by 0.18%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##              3.0    #1988      +/-   ##
==========================================
+ Coverage   44.38%   44.56%   +0.18%     
==========================================
  Files         283      283              
  Lines       17041    17055      +14     
==========================================
+ Hits         7563     7601      +38     
+ Misses       8672     8651      -21     
+ Partials      806      803       -3     
Impacted Files Coverage Δ
cluster/cluster/base/cluster_invoker.go 24.44% <0.00%> (-13.34%) ⬇️
config/graceful_shutdown.go 3.88% <0.00%> (-0.12%) ⬇️
filter/graceful_shutdown/provider_filter.go 74.35% <0.00%> (+0.67%) ⬆️
metrics/prometheus/reporter.go 31.79% <0.00%> (+1.53%) ⬆️
...tocol/rest/server/server_impl/go_restful_server.go 44.82% <0.00%> (+3.44%) ⬆️
registry/zookeeper/service_discovery.go 17.07% <0.00%> (+15.85%) ⬆️
config/graceful_shutdown_config.go 92.72% <0.00%> (+19.39%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us.

}
case <-time.After(20 * time.Second):
Copy link
Contributor

Choose a reason for hiding this comment

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

这一块逻辑的作用?

Copy link
Contributor

Choose a reason for hiding this comment

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

我理解阻塞在这个 select 应该没问题吧?

Copy link
Member Author

Choose a reason for hiding this comment

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

阻塞20秒以后再执行,所以先执行上面的,上面的如果20秒还没有执行完,重新执行说明上面的bug,当然是否可以用户自定义,另外20秒是否过长,这个在dubbo yaml配置文件里面可以用户自定义配置

Copy link

Choose a reason for hiding this comment

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

感觉完全没有必要在在外层加一个for

Copy link
Contributor

Choose a reason for hiding this comment

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

感觉完全没有必要在在外层加一个for

大佬要不一起来DingTalk:44817370 一起聊下?

@jasondeng1997 jasondeng1997 changed the title fix PolarisServiceWatcher bug fix PolarisServiceWatcher bug and add zk ut Jul 22, 2022
@jasondeng1997 jasondeng1997 changed the title fix PolarisServiceWatcher bug and add zk ut fix PolarisServiceWatcher bug and add ZookeeperServiceDiscovery ut Jul 22, 2022
}
case <-time.After(1 * time.Second):
Copy link
Contributor

Choose a reason for hiding this comment

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

感觉这个是可以移除的,应该不太需求

@AlexStocks AlexStocks merged commit 9d88f31 into apache:3.0 Aug 2, 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.

7 participants