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

实例主动下线,向SC发起unregister 返回 400017, leaseId not exist #1407

Open
healer1219 opened this issue Feb 25, 2023 · 1 comment

Comments

@healer1219
Copy link

Describe the bug

  • 服务使用 spring cloud huawei 1.8.0 hoxton
  • SC 为 2.0.0 release 版本
  • 实例下线调用 deregister,向sc发起unregister,返回 400017
  • SC ms.go UnregisterInstance -> revokeInstance -> "Instance's leaseId not exist."
  • 导致实例未及时从sc中 unregister,只能等待 sc 主动清除

To Reproduce
Steps to reproduce the behavior:

  1. springcloud huawei 1.8.0 hoxton
@Component
public class Unregister implements ApplicationListener<ApplicationReadyEvent> {
    @Autowired
    private ServiceCombRegistration serviceCombRegistration;

    @Autowired
    private ServiceCombServiceRegistry serviceCombServiceRegistry;

    @Override
    public void onApplicationEvent(ApplicationReadyEvent event) {
        Runtime.getRuntime().addShutdownHook(
                new Thread(() -> {
                    serviceCombServiceRegistry.deregister(serviceCombRegistration);
                })
        );
    }
}
  1. kill 这个实例

Expected behavior
服务主动调用unregister后应能正常清除实例

Platform And Runtime (please complete the following information):

Platform

  • OS: openEuler 22.03 LTS
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Runtime

  • Version openEuler 22.03 LTS
@little-cui
Copy link
Member

出现这个错误,表示实例已经下线,可以确认下配置的实例心跳间隔

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

No branches or pull requests

2 participants