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

【consul】服务被interrupt之后,并不会立刻从注册中心消失 #749

Closed
JiaLiangoooo opened this issue Sep 10, 2020 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@JiaLiangoooo
Copy link

What happened:
目前注册中心用的consul,服务被强行interrupt, 现象是当前的已经被注册上去的service并不会立即消失. 而是过一段时间后会被注册中心自动删除. registry中的Unregister并不会被调用

What you expected to happen:
服务被interrupt, 应该直接从注册中心UnRegister, 而不应该依赖consul检测后,自动清除

@JiaLiangoooo JiaLiangoooo changed the title 服务被interrupt之后,并不会立马从注册中心消失, 【consul】服务被interrupt之后,并不会立刻从注册中心消失 Sep 10, 2020
@zouyx
Copy link
Member

zouyx commented Sep 13, 2020

yes, you are right .that is a bug, if you know how to fix it , pr is welcome.

@zouyx zouyx added the bug Something isn't working label Sep 13, 2020
@zouyx zouyx added this to the v1.5.3 milestone Sep 13, 2020
@LaurenceLiZhixin
Copy link
Contributor

I created a PR: ,please review:
#787

@JiaLiangoooo
Copy link
Author

目前register的URL与unregister的URL不是一样的,并不会从注册中心下线

register

2020-12-27T21:13:11.672+0800    INFO    consul/utils.go:38      grpc://:20001/Ag2ChatImpl?application=chat&cluster=failover&interface=net.chat.service.Ag2ChatProvider&loadbalance=random&release=dubbo-golang-1.3.0&timestamp=1609074791&warmup=100
2020-12-27T21:13:11.672+0800    INFO    consul/registry.go:95   register--- grpc://192.168.1.102:20001/Ag2ChatImpl?application=chat&cluster=failover&interface=net.chat.service.Ag2ChatProvider&loadbalance=random&release=dubbo-golang-1.3.0&timestamp=1609074791&warmup=100

2020-12-27T21:13:11.660+0800    INFO    consul/utils.go:38      grpc://:20000/GrpcChatImpl?application=chat&cluster=failover&interface=net.chat.service.ChatProvider&loadbalance=chatbl&release=dubbo-golang-1.3.0&timestamp=1609074791&warmup=100
2020-12-27T21:13:11.660+0800    INFO    consul/registry.go:95   register--- grpc://192.168.1.102:20000/GrpcChatImpl?application=chat&cluster=failover&interface=net.chat.service.ChatProvider&loadbalance=chatbl&release=dubbo-golang-1.3.0&timestamp=1609074791&warmup=100

unregister

2020-12-27T21:13:35.547+0800    INFO    consul/registry.go:119  unregister--- consul://127.0.0.1:8500?group=&registry=consul&registry.label=true&registry.preferred=false&registry.role=3&registry.timeout=3s&registry.ttl=10m&registry.weight=0&registry.zone=&simplified=true
2020-12-27T21:13:35.547+0800    INFO    consul/utils.go:38      consul://127.0.0.1:8500?group=&registry=consul&registry.label=true&registry.preferred=false&registry.role=3&registry.timeout=3s&registry.ttl=10m&registry.weight=0&registry.zone=&simplified=true

2020-12-27T21:13:35.549+0800    INFO    consul/registry.go:119  unregister--- consul://127.0.0.1:8500?group=&registry=consul&registry.label=true&registry.preferred=false&registry.role=3&registry.timeout=3s&registry.ttl=10m&registry.weight=0&registry.zone=&simplified=true
2020-12-27T21:13:35.549+0800    INFO    consul/utils.go:38      consul://127.0.0.1:8500?group=&registry=consul&registry.label=true&registry.preferred=false&registry.role=3&registry.timeout=3s&registry.ttl=10m&registry.weight=0&registry.zone=&simplified=true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants