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] RpcException with no provider avaliable messages will be thrown if the newly dubbo reference is immediately called. #14533

Open
3 of 4 tasks
zrlw opened this issue Aug 14, 2024 · 2 comments
Labels
component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage

Comments

@zrlw
Copy link
Contributor

zrlw commented Aug 14, 2024

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

3.2.12

Steps to reproduce this issue

  1. delete local registry cache files.
  2. build a springboot app that has @DubboReference(check = false) to provider A.
  3. create dynamic reference to provider B when the state of DubboApplicationStateEvent is started.
        ReferenceConfig<ProviderB> referenceConfig = new ReferenceConfig<>();
        referenceConfig.setInterface(ProviderB.class);
        referenceConfig.setVersion("...");
        referenceConfig.setGroup("...");
        referenceConfig.setCheck(false);
        referenceConfig.setAsync(true);
        // using DubboBootstrap.getInstance() as the single instance is already created.
        ProviderB providerB = DubboBootstrap.getInstance().getCache().get(referenceConfig);
  1. call any method of providerB immediatly.

What you expected to happen

ReferenceCache shoud provide a get method with timeout paramter to pull the provider instance info from the registry center at the reference creation.

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

@zrlw zrlw added component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage labels Aug 14, 2024
@zrlw
Copy link
Contributor Author

zrlw commented Aug 15, 2024

we take a temporary solution:

ReferenceCache refCache = DubboBootstrap.getInstance().getCache();
ProviderB providerB = refCache.get(referenceConfig);
// set check true temporarily for invoker available checking.
referenceConfig.setCheck(true);
try {
    // check invoker available status.
    refCache.check(referenceConfig, checkTimeoutMs);
} finally {
    // restore check option.
    referenceConfig.setCheck(false);
}
// call provider method.
providerB.methodXXX(....);

@JunJieLiu51520
Copy link
Contributor

JunJieLiu51520 commented Aug 19, 2024

because you have set this 'referenceConfig.setAsync(true);' which is similar to send oneway, do not care response, and if you wan't to use 'async and return value', you can define your interface's resonse to Future

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
Status: Todo
Development

No branches or pull requests

2 participants