You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "wyf027 (via GitHub)" <gi...@apache.org> on 2026/07/14 07:40:11 UTC
[PR] fix: synchronize registry exporter lifecycle publication [dubbo-go]
wyf027 opened a new pull request, #3491:
URL: https://github.com/apache/dubbo-go/pull/3491
### Description
Fixes #3248
This PR addresses the `exporterChangeableWrapper` lifecycle-publication race called out in the lifecycle-management section of the umbrella issue.
`registryProtocol.Export` previously stored a wrapper in `bounds` before its register and subscribe URLs were initialized. Concurrent shutdown or re-export paths could therefore observe a partially published exporter, unregister a nil/wrong URL, or close an exporter whose registration was still in progress.
The change:
- gates `Export` and `reExport` against shutdown with a lifecycle barrier;
- serializes publication per cache key while keeping unrelated providers independent;
- locks old/new cache keys in deterministic order during re-export;
- publishes lifecycle URLs atomically and rolls back a newly created exporter when registration fails;
- makes graceful unregister and destroy idempotent for the same wrapper;
- removes keyed locks when their last holder/waiter exits;
- cleans configuration listeners during destroy.
The timing tests cover blocked registration versus destroy, registration rollback, unrelated-provider progress, old/new-key re-export, same-key re-export, and concurrent unregister/destroy.
Scope note: this is a focused fix for the wrapper publication/shutdown race. It does not redesign the existing one-URL-pair-per-provider multi-registry model. It also does not change the mixed `Registry.Subscribe` contract; strict subscribe readiness/cancellation requires a follow-up API design because some registry implementations run `Subscribe` as a long-lived loop.
### Testing
- `make check-fmt`
- `make test`
- `go test ./registry/protocol -count=10`
- focused lifecycle tests with `-count=20`
- `go test -race ./registry/protocol -count=10`
- `go vet ./registry/protocol`
- `golangci-lint run ./registry/protocol/...`
### Checklist
- [x] I confirm the target branch is `develop`
- [x] Code has passed local testing
- [x] I have added tests that prove my fix is effective or that my feature works
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] fix: synchronize registry exporter lifecycle publication [dubbo-go]
Posted by "Alanxtl (via GitHub)" <gi...@apache.org>.
Alanxtl closed pull request #3491: fix: synchronize registry exporter lifecycle publication
URL: https://github.com/apache/dubbo-go/pull/3491
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] fix: synchronize registry exporter lifecycle publication [dubbo-go]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #3491:
URL: https://github.com/apache/dubbo-go/pull/3491#issuecomment-4966614296
## [Codecov](https://app.codecov.io/gh/apache/dubbo-go/pull/3491?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `76.66667%` with `42 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 54.46%. Comparing base ([`60d1c2a`](https://app.codecov.io/gh/apache/dubbo-go/commit/60d1c2a949f0ee0da4be3fe09fb79d295491e040?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`74e923e`](https://app.codecov.io/gh/apache/dubbo-go/commit/74e923ec550982ebdae7fe7255869e2351a840c7?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 872 commits behind head on develop.
| [Files with missing lines](https://app.codecov.io/gh/apache/dubbo-go/pull/3491?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [registry/protocol/protocol.go](https://app.codecov.io/gh/apache/dubbo-go/pull/3491?src=pr&el=tree&filepath=registry%2Fprotocol%2Fprotocol.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cmVnaXN0cnkvcHJvdG9jb2wvcHJvdG9jb2wuZ28=) | 76.66% | [30 Missing and 12 partials :warning: ](https://app.codecov.io/gh/apache/dubbo-go/pull/3491?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## develop #3491 +/- ##
===========================================
+ Coverage 46.76% 54.46% +7.70%
===========================================
Files 295 462 +167
Lines 17172 35664 +18492
===========================================
+ Hits 8031 19426 +11395
- Misses 8287 14696 +6409
- Partials 854 1542 +688
```
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/dubbo-go/pull/3491?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] fix: synchronize registry exporter lifecycle publication [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3491:
URL: https://github.com/apache/dubbo-go/pull/3491#issuecomment-4966565027
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3491) **Quality Gate passed**
Issues
 [3 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3491&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3491&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3491&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3491&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3491&metric=new_duplicated_lines_density&view=list)
<!-- sqra-placement-anchor -->
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3491)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org