Description
What happened?
When no metadata-center definition is available, a failed Telnet probe is cached at the service level. If discovery later returns a different provider that can supply metadata over Telnet, even a forced metadata refresh reuses the old failure in GetOrLoadTelnetMetadataAsync. Callers that depend on automatic Java-signature inference still can't resolve the method.
Expected: The changed provider set makes the old negative result inapplicable. The next refresh probes B and uses its method signature.
Actual: The last probed port is still 12341. The refresh reuses A's negative result and never tries B.
How can we reproduce it? (optional)
- Use an in-memory provider resolver for one service and an injected Telnet metadata loader. Return provider A (port
12341, release2.7.2, so no metadata-center read is needed). Have A's probe return a failure. - Request the service's method metadata once and confirm that A was probed and the lookup failed.
- Change discovery to provider B (port
12342) of the same service. Have the injected loader return a valid method signature for B. CallRefreshCachedServiceAsyncand request the method metadata again.
Environment
The same test fails on b4b4500 and b9dce71 (apache/dubbo-net#48), with .NET 10 and with the netstandard2.0 library on .NET 8. The repro uses an injected probe; it doesn't need a live Telnet or metadata server. This is distinct from caching a failure when discovery finds no provider. Windows. The test uses an in-memory provider resolver and Telnet loader; no live registry or Telnet server is needed.
Suggested direction
Key the negative result by the relevant provider identity or invalidate it when that provider set changes. Keep the existing one-probe behavior while the provider set remains unchanged.
Activity