Limit config property scanning to mapped classes for configuration cache stability#53006
Limit config property scanning to mapped classes for configuration cache stability#53006cdsap wants to merge 2 commits intoquarkusio:mainfrom
Conversation
This comment has been minimized.
This comment has been minimized.
| return unmodifiableMap(properties); | ||
| } | ||
| }); | ||
| } |
There was a problem hiding this comment.
@radcortez could you please review this code? Thanks!
There was a problem hiding this comment.
Update:
When I tested yesterday, I realized I was hitting the configuration cache after changing the system properties. However, after restarting the Gradle process, I noticed that the problem persisted.
The problem is that making EffectiveConfig values lazy doesn’t help because EffectiveConfig builder is still called. Under the hood it invokes ConfigUtils.emptyConfigBuilder().addSystemSources(), which triggers addDefaultSources() → System.getProperties(), registering every system property as an input regardless of caching.
With the new EffectiveConfig commit, when it is called during the configuration phase, we now use a minimal SmallRyeConfigBuilder (bypassing addDefaultSources()) and inject only the pre-filtered properties at their correct ordinals.
Removing addDefaultSources() means SmallRye no longer has access to JVM system properties like java.home and user.home. However, Quarkus config defaults reference these in
- NativeConfig.javaHome() defaults to ${java.home}
- PackageConfig.DecompilerConfig.jarDirectory() defaults to ${user.home}/.quarkus.
So that's why I'm adding
private static final List<String> JVM_PROPERTIES_FOR_CONFIG_EXPANSION = List.of(
"java.home", "user.home");
to track those system properties. Please, let me know if needs to be expanded.
This new commit also covers the system property change test and clean up the system property usage.
Please review again.
Status for workflow
|
Based on the PR comments on this PR #52507, this PR implements:
@radcortez @aloubyansky