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

Wrong warning message param order / Upstream #26156

Closed
pjgg opened this issue Jun 15, 2022 · 6 comments · Fixed by #26802
Closed

Wrong warning message param order / Upstream #26156

pjgg opened this issue Jun 15, 2022 · 6 comments · Fixed by #26802
Assignees
Labels
area/config kind/bug Something isn't working
Milestone

Comments

@pjgg
Copy link
Contributor

pjgg commented Jun 15, 2022

Describe the bug

Quarkus: 999-snapshot

quarkus.application.name=test-http

When a build param is updated as quarkus.application.name I am getting the following error message:

Note: appName was updated to new-test-app

quarkus.application.name is set to 'test-http' but it is build time fixed to 'new-test-app'. Did you change the property quarkus.application.name after building the application?

I would expect a message like:

quarkus.application.name is set to 'new-test-app' but it is build time fixed to 'test-http'. Did you change the property quarkus.application.name after building the application?

Related to: #23573

Reproducer:

git clone [email protected]:quarkus-qe/quarkus-test-suite.git
mvn clean verify -Dall-modules -pl http/http-minimum -Dit.test=DevModeHttpMinimumIT#verifyWarningLogWhenBuildPropertyIsUpdated

Note: be sure that verifyWarningLogWhenBuildPropertyIsUpdated is enabled

@pjgg pjgg added the kind/bug Something isn't working label Jun 15, 2022
@rsvoboda
Copy link
Member

rsvoboda commented Jun 15, 2022

So I tried to mimic the test scenario, downloaded app, tun it in dev mode.
Navigated to dev UI - Config Editor and changed quarkus.application.name to code-with-quarkus-dd. this triggered application restart and complain about the old app name

__  ____  __  _____   ___  __ ____  ______
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/
2022-06-15 14:05:12,163 INFO  [io.quarkus] (Quarkus Main Thread) code-with-quarkus 1.0.0-SNAPSHOT on JVM (powered by Quarkus 2.9.2.Final) started in 2.704s. Listening on: http://localhost:8080

2022-06-15 14:05:12,181 INFO  [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
2022-06-15 14:05:12,182 INFO  [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, resteasy-reactive, smallrye-context-propagation, vertx]
2022-06-15 14:05:48,628 INFO  [io.qua.dep.dev.RuntimeUpdatesProcessor] ([DevConsole]vert.x-eventloop-thread-0) File change detected: /Users/rsvoboda/Downloads/code-with-quarkus/src/main/resources/application.properties
2022-06-15 14:05:48,633 INFO  [io.qua.dep.dev.RuntimeUpdatesProcessor] ([DevConsole]vert.x-eventloop-thread-0) Restarting quarkus due to changes in application.properties.
2022-06-15 14:05:48,654 INFO  [io.quarkus] (Quarkus Main Thread) code-with-quarkus stopped in 0.020s
__  ____  __  _____   ___  __ ____  ______
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/
2022-06-15 14:05:48,900 WARN  [io.qua.run.con.ConfigRecorder] (Quarkus Main Thread) Build time property cannot be changed at runtime:
 - quarkus.application.name is set to 'code-with-quarkus' but it is build time fixed to 'code-with-quarkus-dd'. Did you change the property quarkus.application.name after building the application?

2022-06-15 14:05:48,904 INFO  [io.quarkus] (Quarkus Main Thread) code-with-quarkus-dd 1.0.0-SNAPSHOT on JVM (powered by Quarkus 2.9.2.Final) started in 0.241s. Listening on: http://localhost:8080
2022-06-15 14:05:48,905 INFO  [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
2022-06-15 14:05:48,905 INFO  [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, resteasy-reactive, smallrye-context-propagation, vertx]
2022-06-15 14:05:48,906 INFO  [io.qua.dep.dev.RuntimeUpdatesProcessor] ([DevConsole]vert.x-eventloop-thread-0) Live reload total time: 0.281s
2022-06-15 14:16:10,445 INFO  [io.quarkus] (Shutdown thread) code-with-quarkus-dd stopped in 0.007s

So imho the warning is correct, because 'code-with-quarkus-dd' is the build time value for the newly started process.

The problem I have is that the old 'code-with-quarkus' is still kept somewhere in the config chain and ConfigProvider in https://github.com/radcortez/quarkus/blob/main/core/runtime/src/main/java/io/quarkus/runtime/configuration/ConfigRecorder.java gives the old value.

CC @radcortez and @geoand

@rsvoboda
Copy link
Member

When I try java -Dquarkus.application.name=fooo -jar target/quarkus-app/quarkus-run.jar I do not receive any warning.

Is ConfigRecorder warning applicable just for dev mode?

@rsvoboda
Copy link
Member

@radcortez can you provide some input to this / what are your plans?

@radcortez
Copy link
Member

Let me have a look.

@radcortez
Copy link
Member

I'll need to go deeper into this. It seems that the generated class is not reloading the build time source in dev mode for runtime (but the build time values are indeed changed and used in the build steps).

For jar mode, the warning probably stopped working when we did this change: #20932

@radcortez
Copy link
Member

The issue was that the BuildTimeRunTime source was not correctly reloaded in Dev mode, causing the warning message and keeping the old config value.

In Dev mode, the warning message should not appear because everything is reloaded, and the app is built again, so it doesn't make sense for the message to appear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/config kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants