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

Allow smallrye-health to return DOWN response compliant with rfc9457 #43209

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

xstefank
Copy link
Member

@xstefank xstefank commented Sep 11, 2024

@xstefank
Copy link
Member Author

@quarkus-bot

This comment has been minimized.

Copy link

github-actions bot commented Sep 11, 2024

🎊 PR Preview b8c5a62 has been successfully built and deployed to https://quarkus-pr-main-43209-preview.surge.sh/version/main/guides/

  • Images of blog posts older than 3 months are not available.
  • Newsletters older than 3 months are not available.

@quarkus-bot

This comment has been minimized.

Copy link
Contributor

@jmartisk jmartisk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@xstefank xstefank force-pushed the health-content-type-43125 branch 2 times, most recently from 9b70379 to add3364 Compare September 12, 2024 10:48
@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

@@ -22,8 +31,14 @@

public abstract class SmallRyeHealthHandlerBase implements Handler<RoutingContext> {

static boolean problemDetails = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that I think of it, this should be volatile

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why please?

Copy link
Contributor

@geoand geoand Sep 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason is that SmallRyeHealthHandlerBase.problemDetails is set by the main thread (although there is no strict contract for this, this is how it works in practice), but the field is read from an event loop thread (but potentially by any thread).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering how much of a potentially unnecessary performance cost it has given that it's only written once. This could be avoided by instead passing it to a constructor of the handler. But maybe the performance cost of it being volatile is negligible.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obviously the best solution (for more than just performance) is to have final fields.

Given that this is not on the hot path, I wouldn't worry much about the (tiny) performance hit

@geoand
Copy link
Contributor

geoand commented Sep 13, 2024 via email

@xstefank
Copy link
Member Author

@geoand I was thinking about it but this is a base class so we would need to go trough 7-8 subclasses to pass it in constructor. So I opted for a field.

@geoand
Copy link
Contributor

geoand commented Sep 13, 2024

Okay, makes sense. Let's just use a volatile

@quarkus-bot
Copy link

quarkus-bot bot commented Sep 13, 2024

Status for workflow Quarkus Documentation CI

This is the status report for running Quarkus Documentation CI on commit 636939a.

✅ 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.

Warning

There are other workflow runs running, you probably need to wait for their status before merging.

@geoand geoand added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Sep 13, 2024
@quarkus-bot
Copy link

quarkus-bot bot commented Sep 13, 2024

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit 636939a.

✅ 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.

@geoand geoand merged commit 888266f into quarkusio:main Sep 13, 2024
48 checks passed
@quarkus-bot quarkus-bot bot added the kind/enhancement New feature or request label Sep 13, 2024
@quarkus-bot quarkus-bot bot added this to the 3.16 - main milestone Sep 13, 2024
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label Sep 13, 2024
@gsmet
Copy link
Member

gsmet commented Sep 13, 2024

This is more a new feature than a fix. We could backport it at some point if there is a strong demand but I would rather have it released in 3.16 first.

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.

Allow smallrye-health to return DOWN response compliant with rfc9457
5 participants