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

call sericeRegistry.deregister,but nacos don't remove the instance #13109

Open
linqr opened this issue Feb 14, 2025 · 4 comments
Open

call sericeRegistry.deregister,but nacos don't remove the instance #13109

linqr opened this issue Feb 14, 2025 · 4 comments
Labels

Comments

@linqr
Copy link

linqr commented Feb 14, 2025

nacos 版本
Server Nacos 2.1.0
client 版本
spring-cloud-starter-alibaba-nacos-discovery-2.1.2.RELEASE.jar
nacos-client-1.2.1.jar

实例类型: 临时实例

应用停止流程
shell调用 调用端点下线,端点内部实际调用代码是
ServiceRegistry serviceRegistry. =SpringUtils.getBean(ServiceRegistry.class);
Regsitraion registration = SpringUtils.getBean(Registration.class);
serviceRegistry.deregister(registration)

客户端日志显示

Image

在21:24:57 显示调用端点成功,已经移除了心跳
21:24:58 又向nacos发送了心跳,检查nacos控制台,实际也未下线。

@linqr
Copy link
Author

linqr commented Feb 14, 2025

NACOS Version
Server Nacos 2.1.0
Client Versions:
spring-cloud-starter-alibaba-nacos-discovery-2.1.2.RELEASE.jar
nacos-client-1.2.1.jar

Instance Type: Ephemeral Instance

Application Shutdown Process
A shell script invokes an endpoint to deregister the instance. The internal code executed by the endpoint is:

ServiceRegistry serviceRegistry = SpringUtils.getBean(ServiceRegistry.class);  
Registration registration = SpringUtils.getBean(Registration.class);  
serviceRegistry.deregister(registration);  

Naming Logs

At 21:24:57, the logs indicate that the endpoint was successfully invoked and the heartbeat was removed.

At 21:24:58, the client unexpectedly sent another heartbeat to Nacos. Verification via the Nacos Control Panel confirms that the instance was not actually deregistered.

@linqr linqr changed the title 优雅停机,springcloud调用sericeRegistry.deregister下线,但nacos上未实际下线 call sericeRegistry.deregister下,but nacos don't remove the instance Feb 14, 2025
@linqr linqr changed the title call sericeRegistry.deregister下,but nacos don't remove the instance call sericeRegistry.deregister,but nacos don't remove the instance Feb 14, 2025
@KomachiSion
Copy link
Collaborator

注销时需要使用注册的同一个nacos-client进行。否则不能实际移除心跳和连接。

@KomachiSion
Copy link
Collaborator

可以考虑升级一下SCA版本, 新版本SCA可能修复了这个问题。

@linqr
Copy link
Author

linqr commented Feb 18, 2025

注销时需要使用注册的同一个nacos-client进行。否则不能实际移除心跳和连接。

注销的时候,是直接调用对应应用的端点,是同一个nacos-client

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

No branches or pull requests

2 participants