spring-cloud-config icon indicating copy to clipboard operation
spring-cloud-config copied to clipboard

Let config client fail before bean creation

Open hpoettker opened this issue 4 years ago • 3 comments

If the config client fails and fail fast is enabled, the ConfigClientFailFastException will already be thrown when the bootstrap context is closed instead of during auto-configuration.

This allows the deferred logs to be printed properly while it avoids failure on the creation of beans that depend on values provided by the config server.

The change simplifies the handling of the ConfigClientFailFastException that has been introduced in https://github.com/spring-cloud/spring-cloud-config/commit/e9fa34032b67301831dfe73882bb61b1b2330d43.

Fixes gh-1963.

hpoettker avatar Oct 10 '21 21:10 hpoettker

Codecov Report

Base: 78.16% // Head: 78.01% // Decreases project coverage by -0.15% :warning:

Coverage data is based on head (6799339) compared to base (cc22b88). Patch coverage: 77.83% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1977      +/-   ##
============================================
- Coverage     78.16%   78.01%   -0.16%     
- Complexity     1509     1522      +13     
============================================
  Files           189      192       +3     
  Lines          5532     5598      +66     
  Branches        720      721       +1     
============================================
+ Hits           4324     4367      +43     
- Misses          931      949      +18     
- Partials        277      282       +5     
Impacted Files Coverage Δ
...d/config/client/ConfigClientAutoConfiguration.java 24.00% <0.00%> (-38.50%) :arrow_down:
...fig/client/ConfigClientRequestTemplateFactory.java 71.69% <0.00%> (-4.31%) :arrow_down:
...ud/config/client/ConfigServerConfigDataLoader.java 63.12% <0.00%> (+0.39%) :arrow_up:
...nvironment/HttpClientVaultRestTemplateFactory.java 100.00% <ø> (ø)
...ager/GoogleSecretManagerAccessStrategyFactory.java 30.76% <33.33%> (-2.57%) :arrow_down:
...vault/SpringVaultEnvironmentRepositoryFactory.java 85.71% <66.66%> (ø)
...nfig/server/environment/EnvironmentController.java 91.95% <80.00%> (ø)
...loud/config/server/support/HttpClient4Support.java 82.05% <82.05%> (ø)
...config/DefaultTextEncryptionAutoConfiguration.java 83.33% <83.33%> (ø)
.../server/environment/JdbcEnvironmentRepository.java 78.33% <88.23%> (+7.96%) :arrow_up:
... and 26 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov[bot] avatar Oct 10 '21 21:10 codecov[bot]

The failed codecov check seems like a false positive to me. It probably got tripped up because ApplicationFailFastTests is contained in a different module (spring-cloud-config-sample) than the change itself (spring-cloud-config-client).

hpoettker avatar Oct 10 '21 21:10 hpoettker

This PR and the issue it's intended to solve have now been open for quite some time. I still think that the problem described in the issue makes operating the config service in a real world scenario of corporate firewalls harder to troubleshoot than necessary.

Any feedback on the PR would really be appreciated. If it needs work, I'm perfectly willing to resolve any issues.

hpoettker avatar Feb 23 '22 17:02 hpoettker

I've resolved a merge conflict and rebased the PR on main. The code coverage alerts still seem like false positives to me.

The PR has now been open for a year. And over this time, there have been thumps ups on the issue and the PR and also a supportive comment on the issue.

Is there a known unintended change in behavior that the proposal would cause? If yes, please let me know, and I'll try to change the PR accordingly.

Is the PR only perceived as risky without a clear idea what might break? In that case, the upcoming release of version 4 seems to me like a very good point in time to take this risk.

hpoettker avatar Oct 20 '22 11:10 hpoettker

Is there any progress on this PR? May I help in any ways? I just debugged today in our CI infrastructure, because the config-client failed and errors were hidden by other exceptions due to missing configuration properties

babubabu avatar Jan 03 '23 17:01 babubabu

This seems to make sense to me.

@spencergibb what do you think?

ryanjbaxter avatar Feb 10 '23 13:02 ryanjbaxter

Seems ok to me

spencergibb avatar Feb 10 '23 14:02 spencergibb

Thanks a lot!

babubabu avatar Feb 10 '23 14:02 babubabu