mirror of
https://github.com/jlengrand/quarkus.git
synced 2026-03-10 00:31:22 +00:00
Merge pull request #7335 from dmlloyd/revert-fj-config
Partially revert "Fix issue getting config from fork join pool"
This commit is contained in:
@@ -728,6 +728,8 @@ public final class RunTimeConfigurationGenerator {
|
||||
}
|
||||
|
||||
private void installConfiguration(ResultHandle config, MethodCreator methodCreator) {
|
||||
// install config
|
||||
methodCreator.invokeStaticMethod(QCF_SET_CONFIG, config);
|
||||
// now invalidate the cached config, so the next one to load the config gets the new one
|
||||
final ResultHandle configProviderResolver = methodCreator.invokeStaticMethod(CPR_INSTANCE);
|
||||
try (TryBlock getConfigTry = methodCreator.tryBlock()) {
|
||||
@@ -737,8 +739,6 @@ public final class RunTimeConfigurationGenerator {
|
||||
// ignore
|
||||
getConfigTry.addCatch(IllegalStateException.class);
|
||||
}
|
||||
// install config
|
||||
methodCreator.invokeStaticMethod(QCF_SET_CONFIG, config);
|
||||
}
|
||||
|
||||
private void generateDefaultValuesConfigSourceClass(ConfigPatternMap<Container> patternMap, String className) {
|
||||
|
||||
@@ -36,17 +36,9 @@ public final class QuarkusConfigFactory extends SmallRyeConfigFactory {
|
||||
}
|
||||
|
||||
public static void setConfig(SmallRyeConfig config) {
|
||||
//This is a hack, but there is not a great deal that can be done about it
|
||||
//it is possible that when running in test/dev mode some code will be run with the system TCCL
|
||||
//e.g. when using the fork join pool
|
||||
//if this happens any use of config will fail, as the system class loader will resolve the
|
||||
//wrong instance of the config classes
|
||||
if (QuarkusConfigFactory.config != null) {
|
||||
ConfigProviderResolver.instance().releaseConfig(QuarkusConfigFactory.config);
|
||||
}
|
||||
if (config != null) {
|
||||
ConfigProviderResolver.instance().registerConfig(config, ClassLoader.getSystemClassLoader());
|
||||
}
|
||||
QuarkusConfigFactory.config = config;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user