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

[Bug] NPE in RegistryProtocol.ExporterChangeableWrapper#unregister when shutting down application #14388

Closed
4 tasks done
binfeiruci opened this issue Jul 2, 2024 · 2 comments
Labels
component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage

Comments

@binfeiruci
Copy link
Contributor

Pre-check

  • I am sure that all the content I provide is in English.

Search before asking

  • I had searched in the issues and found no similar issues.

Apache Dubbo Component

Java SDK (apache/dubbo)

Dubbo Version

Dubbo Java 3.2.5, OpenJDK 1.8

Steps to reproduce this issue

Got the warn log below sometimes when shutting down our Dubbo-Spring integrated application.

 [DUBBO] null, dubbo version: 3.2.6-HA.1.0.5-RELEASE, current host: 10.232.232.201, error code: 99-0. This may be caused by unknown error in registry module, go to https://dubbo.apache.org/faq/99/0 to find instructions. 
java.lang.NullPointerException
  org.apache.dubbo.registry.integration.RegistryProtocol$ExporterChangeableWrapper.unregister(RegistryProtocol.java:1052)
  org.apache.dubbo.registry.integration.RegistryProtocol$DestroyableExporter.unregister(RegistryProtocol.java:760)
  org.apache.dubbo.config.ServiceConfig.unexport(ServiceConfig.java:208)
  ...

The corresponding thread name is SpringApplicationShutdownHook.

What you expected to happen

DubboShutdownHook waited DubboDeployApplicationListener(within SpringApplicationShutdownHook thread) to destroy the applicationMode for 10 seconds(default), then it will continue executing.
If things happened in the order below, we will get this warn log.

  1. RegistryProtocol.ExporterChangeableWrapper#unregister loop applicationModel.getPubModuleModels() in thread SpringApplicationShutdownHook
  2. DubboShutdownHook destroy a moduleModel, set the moduleModel's serviceRepository to null.
  3. RegistryProtocol.ExporterChangeableWrapper#unregister will get NPE when calling moduleModel.getServiceRepository().getExportedServices()

Anything else

No response

Are you willing to submit a pull request to fix on your own?

  • Yes I am willing to submit a pull request on my own!

Code of Conduct

@binfeiruci binfeiruci added component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage labels Jul 2, 2024
@wcy666103
Copy link
Contributor

I think it is similar to this issue #10150 (comment) , can you help us solve this problem through pr?

@oxsean
Copy link
Collaborator

oxsean commented Jul 2, 2024

Please add a readable title.

@binfeiruci binfeiruci changed the title [Bug] [Bug] NPE in RegistryProtocol.ExporterChangeableWrapper#unregister when shutting down application Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage
Projects
Archived in project
Development

No branches or pull requests

3 participants