feat: isolate dual-registration failure handling per mode#16248
Open
ban-xiu wants to merge 4 commits intoapache:3.3from
Open
feat: isolate dual-registration failure handling per mode#16248ban-xiu wants to merge 4 commits intoapache:3.3from
ban-xiu wants to merge 4 commits intoapache:3.3from
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 3.3 #16248 +/- ##
============================================
+ Coverage 60.78% 60.81% +0.03%
- Complexity 11763 11779 +16
============================================
Files 1953 1953
Lines 89186 89224 +38
Branches 13454 13458 +4
============================================
+ Hits 54209 54259 +50
+ Misses 29400 29395 -5
+ Partials 5577 5570 -7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change?
Close #16247.
Problem
In dual registration mode (register-mode=all) Dubbo emits a single provider URL through two registries:
- interface-level -> registry:// (ZooKeeper, Nacos, ...) - instance-level -> service-discovery-registry://
RegistryProtocol#export calls register() once; the registry wrapper
fans out to both arms. Any RuntimeException from the first arm aborts
the second, so a transient failure on the metadata center silently
takes down the interface-level registration that was otherwise healthy
(or vice versa). The pre-existing FrameworkStatusReportService only
reports a coarse "instance/interface" status and cannot tell observers
which arm failed, which swallowed the error, or why.
Fix
FrameworkStatusReportService
success, errorMessage) + createRegistrationOutcomeReport() so each
registration attempt emits an independently tagged payload
{application, mode, registry, service, status, error?}.
RegistryProtocol
the existing register() call with per-arm failure isolation:
otherwise log a warn under CONFIG_REGISTER_INSTANCE_ERROR
(5-11) and return false so the sibling arm keeps going
INSTANCE_REGISTER label (previously hardcoded in one log line).
the new wrapper; replace the hardcoded "[INSTANCE_REGISTER]" log
prefix with the resolved tag.
(wrapped in try/catch(Throwable)).
Tests
testReportRegistrationOutcomeSuccess / Failure covering the new
payload shape.
reflection-driven cases over registerWithModeTag — success paths for
both protocols, check=true rethrow path, check=false swallow path.
A local CapturingFrameworkStatusReporter + SPI registration under
src/test/resources provides the capture sink (MockFrameworkStatus-
Reporter is scoped to dubbo-common tests and not reachable here).
Behavior change
registrationreportstatus=SUCCESScheck=falseon that registry URLFAILED, returns false,check=trueFAILEDthen the original exception is rethrownChecklist