diff --git a/core/deployment/src/main/java/io/quarkus/deployment/steps/RuntimeConfigSetupBuildStep.java b/core/deployment/src/main/java/io/quarkus/deployment/steps/RuntimeConfigSetupBuildStep.java index ef5fcb0467473..882a3fb262790 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/steps/RuntimeConfigSetupBuildStep.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/steps/RuntimeConfigSetupBuildStep.java @@ -13,6 +13,7 @@ import io.quarkus.gizmo.ClassCreator; import io.quarkus.gizmo.ClassOutput; import io.quarkus.gizmo.MethodCreator; +import io.quarkus.gizmo.MethodDescriptor; import io.quarkus.runtime.StartupContext; import io.quarkus.runtime.StartupTask; @@ -41,6 +42,8 @@ void setupRuntimeConfig( method.getMethodParam(0), method.load("RuntimeConfigSetupBuildStep.setupRuntimeConfig")); method.invokeStaticMethod(C_CREATE_RUN_TIME_CONFIG); + method.invokeStaticMethod(MethodDescriptor.ofMethod("io.quarkus.runtime.ApplicationLifecycleManager", + "setConfigSetupCompleted", void.class, boolean.class), method.load(true)); method.returnValue(null); } } diff --git a/core/runtime/src/main/java/io/quarkus/runtime/ApplicationLifecycleManager.java b/core/runtime/src/main/java/io/quarkus/runtime/ApplicationLifecycleManager.java index 75bf5410976c3..b956bd83b063b 100644 --- a/core/runtime/src/main/java/io/quarkus/runtime/ApplicationLifecycleManager.java +++ b/core/runtime/src/main/java/io/quarkus/runtime/ApplicationLifecycleManager.java @@ -81,6 +81,9 @@ private ApplicationLifecycleManager() { private static ShutdownHookThread shutdownHookThread; private static int exitCode = -1; + // this is used to determine if the config setup has completed to determine if we can use logs or not for error + // reporting in early crashes. Its value is set by io.quarkus.deployment.steps.RuntimeConfigSetup#deploy + private static boolean configSetupCompleted; private static volatile boolean shutdownRequested; private static volatile Application currentApplication; private static boolean vmShuttingDown; @@ -205,8 +208,12 @@ public static void run(Application application, Class