Skip to content

[Dubbo-16573] Resume Consul watches after transient errors - #673

Open
wozhenbang2004 wants to merge 6 commits into
apache:masterfrom
wozhenbang2004:fix/consul-watch-recovery-16573
Open

wozhenbang2004 wants to merge 6 commits into
apache:masterfrom
wozhenbang2004:fix/consul-watch-recovery-16573

Conversation

@wozhenbang2004

Copy link
Copy Markdown

What is the purpose of the change

A transient failure during a Consul blocking query currently ends the background watch. After Consul recovers, the consumer can keep using a stale provider list because the watch has stopped.

Fixes apache/dubbo#16573.

Brief changelog

  • Retry transport failures, HTTP 429 and 5xx with a one-second delay in both Consul watch paths. Unsubscribe and thread interruption still stop the watch.
  • Advance the wildcard catalog index after its service lookups succeed, so a failed lookup can retry the same catalog revision.

Verifying this change

Three regression tests exercise a real loopback HTTP endpoint. They cover the interface registry, service discovery, and wildcard subscriptions with a failed service lookup. All three fail on the unmodified source and pass with the fix. Checkstyle reports zero violations.

mvn -pl :dubbo-registry-consul -am -Pcheckstyle -DskipIntegrationTests=false -Dtest=ConsulWatchRecoveryTest -Dsurefire.failIfNoSpecifiedTests=false test

The existing ConsulRegistryTest could not start its embedded Consul because the local test environment could not resolve releases.hashicorp.com.

  • Link the GitHub issue and limit the change to that issue.
  • Use the Dubbo PR title format and meaningful commit subjects.
  • Explain the problem and the change.
  • Add regression tests.
  • Complete the full repository unit and integration suites.

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

Successfully merging this pull request may close these issues.

[Bug] Consul registry watch silently stops after a transient query exception and does not recover

1 participant