-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Don't fail Hibernate Validator when no RESTEasy Reactive request is in progress #19844
Conversation
This comment has been minimized.
This comment has been minimized.
...ver/runtime/src/main/java/org/jboss/resteasy/reactive/server/injection/ContextProducers.java
Outdated
Show resolved
Hide resolved
…n flight Relates to: quarkusio#19834
a6aea2a
to
ee298ec
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some questions.
headers.getLength(); // this forces the creation of the actual object which will fail if there is no request in flight | ||
return headers; | ||
} catch (IllegalStateException e) { | ||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not possible to return an empty header object? I'm not sure I understand how the case of not having a request can happen and when the user will be confronted to it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I understand from the OP's case is that ResteasyReactiveRequestContext.getHttpHeaders()
fails somehow. I'm wondering if we should return empty headers there and thus cover this case entirely.
Note that I have absolutely no knowledge of the RR codebase so I'm just thinking out loud, given the pattern above looks hackyish and fixing the issue at the source might be a more general solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
org.jboss.resteasy.reactive.server.injection.ContextProducers.getHttpHeaders()
would indeed make sense to return an empty headers in this case. However it does not make sense for others in ContextProducers
, so we need a consistent approach.
@@ -123,6 +123,7 @@ | |||
<module>class-transformer</module> | |||
<module>shared-library</module> | |||
<module>hibernate-validator</module> | |||
<module>hibernate-validator-resteasy-reactive</module> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this new module be listed in https://github.com/quarkusio/quarkus/blob/main/.github/native-tests.json?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe let's not add minutes to the native build if we don't think native will introduce issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was my though exactly for not adding it
Failing Jobs - Building ee298ec
Full information is available in the Build summary check run. Failures⚙️ JVM Tests - JDK 11 #- Failing: extensions/smallrye-reactive-messaging-kafka/deployment
! Skipped: docs integration-tests/kubernetes/quarkus-standard-way-kafka integration-tests/reactive-messaging-kafka and 1 more 📦 extensions/smallrye-reactive-messaging-kafka/deployment✖
|
The failure is completely unrelated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about the pattern as that's typically the type of pattern that could bite us later but I'll trust you on that :).
You know by know that I'll be the first one to say you were right if the future proves you correct :) |
Relates to: #19834