You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by "slievrly (via GitHub)" <gi...@apache.org> on 2026/09/26 06:48:47 UTC
[PR] bugfix: distinguish optional file configuration fallback from provider errors [incubator-seata]
slievrly opened a new pull request, #8244:
URL: https://github.com/apache/incubator-seata/pull/8244
- [x] I have read the contributing guidelines.
- [x] I have registered the PR changes.
### Ⅰ. Describe what this PR did
Treat an absent optional file ConfigurationProvider as a normal fallback to built-in FileConfiguration. Keep ERROR diagnostics for missing non-file providers and for provider instantiation failures, and retain explicit file-provider overrides.
### Ⅱ. Does this pull request fix one issue?
Fixes #6886.
### Ⅲ. Test cases
Tests assert logging and return values for absent file providers, missing remote providers, broken file providers, and a successful file-provider override.
### Ⅳ. Describe how to verify it
Java 17: `mvn -pl config/seata-config-core -am test -Dtest=ConfigurationProviderFallbackTest,ConfigurationFactoryTest -Dsurefire.failIfNoSpecifiedTests=false` — 10 tests passed. git diff --check passed.
### Ⅴ. Special notes for reviews
Source: [Java 17 CI job](https://github.com/apache/incubator-seata/actions/runs/35840434140/job/107113931949).
--
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: distinguish optional file configuration fallback from provider errors [incubator-seata]
Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes merged PR #8244:
URL: https://github.com/apache/incubator-seata/pull/8244
--
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: distinguish optional file configuration fallback from provider errors [incubator-seata]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #8244:
URL: https://github.com/apache/incubator-seata/pull/8244#discussion_r4110502877
##########
config/seata-config-core/src/main/java/org/apache/seata/config/ConfigurationFactory.java:
##########
@@ -225,6 +225,12 @@ private static Configuration getNonSpringConfiguration(String configTypeName) {
ConfigurationProvider.class, Objects.requireNonNull(configTypeName), false)
.provide();
return configuration;
+ } catch (EnhancedServiceNotFoundException exx) {
+ if (FILE_TYPE.equalsIgnoreCase(configTypeName) && exx.getCause() == null) {
Review Comment:
`cause == null` does not distinguish an absent provider from a provider that failed during instantiation. `EnhancedServiceLoader` wraps instantiation failures in an `EnhancedServiceNotFoundException` built only with a message (see `common/src/main/java/org/apache/seata/common/loader/EnhancedServiceLoader.java:459-464`), so those failures also have a null cause and will be silently downgraded for `file`. A provider can likewise throw this exception from `provide()` without a cause. Preserve/inspect a reliable missing-provider signal (for example, preserve the wrapped cause in the loader and classify only the direct no-definition exception) so broken file providers continue to emit ERROR as intended.
--
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: distinguish optional file configuration fallback from provider errors [incubator-seata]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #8244:
URL: https://github.com/apache/incubator-seata/pull/8244#issuecomment-5844080752
## [Codecov](https://app.codecov.io/gh/apache/incubator-seata/pull/8244?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 73.22%. Comparing base ([`96e84e5`](https://app.codecov.io/gh/apache/incubator-seata/commit/96e84e52f1013c484ef524afefdc81a2fb981d18?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`5e7e336`](https://app.codecov.io/gh/apache/incubator-seata/commit/5e7e3364e8710b983d52eb074d19add3d422f1a2?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 @@
## 2.x #8244 +/- ##
============================================
- Coverage 73.33% 73.22% -0.12%
Complexity 1146 1146
============================================
Files 1153 1153
Lines 42348 42353 +5
Branches 5061 5062 +1
============================================
- Hits 31056 31011 -45
- Misses 8811 8865 +54
+ Partials 2481 2477 -4
```
| [Files with missing lines](https://app.codecov.io/gh/apache/incubator-seata/pull/8244?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [.../org/apache/seata/config/ConfigurationFactory.java](https://app.codecov.io/gh/apache/incubator-seata/pull/8244?src=pr&el=tree&filepath=config%2Fseata-config-core%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fconfig%2FConfigurationFactory.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29uZmlnL3NlYXRhLWNvbmZpZy1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZWF0YS9jb25maWcvQ29uZmlndXJhdGlvbkZhY3RvcnkuamF2YQ==) | `76.50% <100.00%> (-0.52%)` | :arrow_down: |
... and [22 files with indirect coverage changes](https://app.codecov.io/gh/apache/incubator-seata/pull/8244/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
[](https://app.codecov.io/gh/apache/incubator-seata/pull/8244?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
</details>
<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.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</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: distinguish optional file configuration fallback from provider errors [incubator-seata]
Posted by "slievrly (via GitHub)" <gi...@apache.org>.
slievrly commented on code in PR #8244:
URL: https://github.com/apache/incubator-seata/pull/8244#discussion_r4167297275
##########
config/seata-config-core/src/main/java/org/apache/seata/config/ConfigurationFactory.java:
##########
@@ -225,6 +225,12 @@ private static Configuration getNonSpringConfiguration(String configTypeName) {
ConfigurationProvider.class, Objects.requireNonNull(configTypeName), false)
.provide();
return configuration;
+ } catch (EnhancedServiceNotFoundException exx) {
+ if (FILE_TYPE.equalsIgnoreCase(configTypeName) && exx.getCause() == null) {
Review Comment:
Confirmed. Commit 19f42d9b3 preserves the underlying cause in both EnhancedServiceLoader construction-failure wrappers and separates provider lookup from provide(), so an exception thrown by provide() cannot be classified as an absent optional provider. Added tests exercising actual failing SPI construction and provide() throwing a cause-less EnhancedServiceNotFoundException. EnhancedServiceLoaderTest: 18 passed; ConfigurationProviderFallbackTest: 5 passed.
--
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