Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.x] LazyConfigSource is now queried when an unknown node is requested #8707

Merged
merged 2 commits into from
May 2, 2024

Conversation

tomas-langer
Copy link
Member

@tomas-langer tomas-langer commented Apr 29, 2024

Description

Previously LazyConfigSource was invoked only for nodes that existed in other config sources. If a node was not known by the config system, it would always return an empty value, even if one of the lazy config sources could provide a value for it.

This PR introduces a change where we first check if the key exists in any lazy source before caching it as non-existent.
As usual with Helidon Config, changes in time are not reflected, as the config tree is considered a snapshot of configuration (even though the lazy config source may introduce a value later in time, it is still considered immutable, and changes must be handled through change API).

Resolves #8709

Documentation

We are currently missing documentation of LazyConfigSource and I did not add it as part of this PR.

@tomas-langer tomas-langer added config 4.x Version 4.x labels Apr 29, 2024
@tomas-langer tomas-langer self-assigned this Apr 29, 2024
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Apr 29, 2024
@tomas-langer tomas-langer changed the title LazyConfigSource is now queried when an unknown node is requested [4.x] LazyConfigSource is now queried when an unknown node is requested Apr 29, 2024
…Map, as computeIfAbsent should

not be used for possibly blocking operations (which we need).
@tomas-langer
Copy link
Member Author

Rebased on current main due to failure of examples build on MacOS, that had wrong protoc version.

@tomas-langer tomas-langer merged commit fd27d4a into helidon-io:main May 2, 2024
12 checks passed
@tomas-langer tomas-langer deleted the 7745-lazy-config branch May 2, 2024 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x Version 4.x config OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
2 participants