apache / apache/dubbo

[Bug] RpcException with no provider avaliable messages will be thrown if the newly dubbo reference is immediately called.

Open
#14,533 2 comments 0 reactions 0 assignees View on GitHub
component/need-triage type/need-triage
Dominant language
Java
Stars
41.6k
Forks
26.4k
Avg merge
15h 13m
Merged PRs (30d)
4

Description

### Pre-check

- [X] I am sure that all the content I provide is in English.

### Search before asking

- [X] I had searched in the [issues](https://github.com/apache/dubbo/issues?q=is%3Aissue) 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 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);
```
4. 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

- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.