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

ConfigRecorder: fix value changed check with null build-time values #38177

Merged

Conversation

SIMULATAN
Copy link
Contributor

This is a fix for a bug I encountered in production where the whole application would crash with a cryptic message:
logs + stack trace

After remote debugging it, I found the problem to be the particular line I changed. The bug occurs when a build-time property is null as it tries to call equals on this value to check for runtime config changes.

One case in which this happens is when environment variables that aren't set are used in a config value. In particular, using, say, $POSTGRES_USER as a variable in %prod.quarkus.datasource.url causes the build-time value to evaluate to null with rawValue being the property without the variables substituted.
values at exception time in the debugger

This PR changes the logic to use Objects.equals which is null safe. If the build-time value is null, it'll detect it as a change (as long as the runtime value isn't null too)

Note for maintainers: the commit is unsigned as I recently changed my email and haven't updated my PGP key. Squash merge the PR to sign the commit with GitHub's key

@radcortez radcortez force-pushed the configrecorder-fix-null-value-check branch from 3eefe76 to 0ebd47b Compare January 15, 2024 11:08
Copy link

quarkus-bot bot commented Jan 15, 2024

✔️ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.

@gastaldi gastaldi merged commit 83a6417 into quarkusio:main Jan 15, 2024
50 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.7 - main milestone Jan 15, 2024
@gsmet gsmet modified the milestones: 3.7 - main, 3.6.6 Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants