You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by "VanKhanhAnny (via GitHub)" <gi...@apache.org> on 2026/03/22 14:53:13 UTC
[PR] bugfix: fail fast for unimplemented registry types in InitRegistry [incubator-seata-go]
VanKhanhAnny opened a new pull request, #1077:
URL: https://github.com/apache/incubator-seata-go/pull/1077
<!-- Thanks for sending a pull request!
-->
<!-- Please make sure you have read and understood the contributing guidelines -->
- [x] I have registered the PR [changes](https://github.com/apache/incubator-seata-go/tree/master/changes).
**What this PR does**:
Make `pkg/discovery.InitRegistry(...)` fail fast for currently recognized but unimplemented registry types (`nacos`, `eureka`, `redis`, `zk`, `consul`, and `sofa`) and add test coverage for those cases
**Which issue(s) this PR fixes**:
Fixes a discovery initialization bug where unimplemented registry types are accepted by name without returning a clear error
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
_If PR is about `failing-tests or flakes`, please post the related issues/tests in a comment and do not use `Fixes`_*
-->
Fixes #1076
**Special notes for your reviewer**:
This PR is intentionally small and focused on the registry initialization path only. It does not implement new registry adapters and it makes the current support boundary explicit and adds tests for the fail-fast behavior
**Does this PR introduce a user-facing change?**:
Yes. Configuring an unimplemented registry type now fails fast with a clear error instead of being accepted silently during registry initialization
<!--
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->
```release-note
Make `InitRegistry` fail fast for currently unimplemented registry types and add tests covering those cases
```
--
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@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] bugfix: fail fast for unimplemented registry types in InitRegistry [incubator-seata-go]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #1077:
URL: https://github.com/apache/incubator-seata-go/pull/1077#issuecomment-4124613147
## [Codecov](https://app.codecov.io/gh/apache/incubator-seata-go/pull/1077?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 56.91%. Comparing base ([`1b526c3`](https://app.codecov.io/gh/apache/incubator-seata-go/commit/1b526c361555fcb6d7ef50221ba296bc022ae674?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`d60cf65`](https://app.codecov.io/gh/apache/incubator-seata-go/commit/d60cf652cf611006ab260f7ef0160fa2f9a4ee97?dropdown=coverage&el=desc&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 @@
## master #1077 +/- ##
=======================================
Coverage 56.91% 56.91%
=======================================
Files 266 266
Lines 17488 17484 -4
=======================================
- Hits 9953 9951 -2
+ Misses 6706 6703 -3
- Partials 829 830 +1
```
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/incubator-seata-go/pull/1077?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@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] bugfix: fail fast for unimplemented registry types in InitRegistry [incubator-seata-go]
Posted by "thunguo (via GitHub)" <gi...@apache.org>.
thunguo commented on PR #1077:
URL: https://github.com/apache/incubator-seata-go/pull/1077#issuecomment-4124602644
Great work! However, I think this part of the processing is not necessary at the moment. Our next plan is to implement a multi-registration center feature, which will solve this problem.
--
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@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] bugfix: fail fast for unimplemented registry types in InitRegistry [incubator-seata-go]
Posted by "VanKhanhAnny (via GitHub)" <gi...@apache.org>.
VanKhanhAnny commented on PR #1077:
URL: https://github.com/apache/incubator-seata-go/pull/1077#issuecomment-4106399874
I opened a PR for this: #1077
--
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@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] bugfix: fail fast for unimplemented registry types in InitRegistry [incubator-seata-go]
Posted by "Ethan-Xingyue (via GitHub)" <gi...@apache.org>.
Ethan-Xingyue closed pull request #1077: bugfix: fail fast for unimplemented registry types in InitRegistry
URL: https://github.com/apache/incubator-seata-go/pull/1077
--
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@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] bugfix: fail fast for unimplemented registry types in InitRegistry [incubator-seata-go]
Posted by "AlexStocks (via GitHub)" <gi...@apache.org>.
AlexStocks commented on code in PR #1077:
URL: https://github.com/apache/incubator-seata-go/pull/1077#discussion_r3004225321
##########
pkg/discovery/init.go:
##########
@@ -35,18 +35,8 @@ func InitRegistry(serviceConfig *ServiceConfig, registryConfig *RegistryConfig)
case ETCD:
//init etcd registry
registryService = newEtcdRegistryService(serviceConfig, ®istryConfig.Etcd3)
- case NACOS:
- //TODO: init nacos registry
- case EUREKA:
- //TODO: init eureka registry
- case REDIS:
- //TODO: init redis registry
- case ZK:
- //TODO: init zk registry
- case CONSUL:
- //TODO: init consul registry
- case SOFA:
- //TODO: init sofa registry
+ case NACOS, EUREKA, REDIS, ZK, CONSUL, SOFA:
Review Comment:
[P1] 将未实现的注册中心类型改为返回错误,实现快速失败。原代码 TODO 注释静默跳过导致用户无法感知配置错误。
--
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@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org