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

Http2 does not work with reactive routes in quarkus dev mode #16170

Closed
lrotim opened this issue Apr 1, 2021 · 4 comments · Fixed by #16460
Closed

Http2 does not work with reactive routes in quarkus dev mode #16170

lrotim opened this issue Apr 1, 2021 · 4 comments · Fixed by #16460
Labels
area/devmode kind/bug Something isn't working
Milestone

Comments

@lrotim
Copy link

lrotim commented Apr 1, 2021

Describe the bug

When using enabling http2 & SSL receiving a request from browser that is processed via HTTP2 on quarkus backend yields java.lang.IllegalStateException: Request has already been read Error if using reactive route in dev mode

As far as I can see in VertxHttpRecorder there is an attempt to resume a request which raises an error - This "Recorder" is added in front of any Route added with @route annotation

If Http1.1 is used the same code works ok

Expected behavior

That a route would serve the request without raising an error

Actual behavior

Registering any Reactive route results in raising an IllegalStateException

To Reproduce

I've setup a small example repo on git https://github.com/lrotim/quarkus-bug.git

Steps to reproduce the behavior:

  1. git clone https://github.com/lrotim/quarkus-bug.git
  2. cd quarkus-bug
  3. Run quarkus in dev mode with provided certificate for SSL (dev certificates are in the given repo), command: mvn -Dquarkus.http.ssl.certificate.file="$(pwd)/dev.com+3.pem" -Dquarkus.http.ssl.certificate.key-file="$(pwd)/dev.com+3-key.pem" quarkus:dev
  4. Goto http://localhost:8080/hello -> works without error, using HTTP1.1
  5. Goto https://localhost:8443/hello -> raises an error, using HTTP2

Configuration

quarkus.http.http2=true
quarkus.http.ssl-port=8443

Environment (please complete the following information):

Output of uname -a or ver

Darwin nb-lrotim.local 20.2.0 Darwin Kernel Version 20.2.0: Wed Dec 2 20:39:59 PST 2020; root:xnu-7195.60.75~1/RELEASE_X86_64 x86_64

Output of java -version

openjdk version "11.0.6" 2020-01-14
OpenJDK Runtime Environment GraalVM CE 20.0.0 (build 11.0.6+9-jvmci-20.0-b02)
OpenJDK 64-Bit Server VM GraalVM CE 20.0.0 (build 11.0.6+9-jvmci-20.0-b02, mixed mode, sharing)

Quarkus version or git rev

1.13.0.Final

Build tool (ie. output of mvnw --version or gradlew --version)

Maven home: /Users/leonrotim/.m2/wrapper/dists/apache-maven-3.6.3-bin/1iopthnavndlasol9gbrbg6bf2/apache-maven-3.6.3
Java version: 11.0.6, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/graalvm-ce-java11-20.0.0/Contents/Home
Default locale: en_GB, platform encoding: UTF-8
OS name: "mac os x", version: "10.16", arch: "x86_64", family: "mac"

@lrotim lrotim added the kind/bug Something isn't working label Apr 1, 2021
@gsmet
Copy link
Member

gsmet commented Apr 1, 2021

@stuartwdouglas could you have a look?

@cescoffier
Copy link
Member

That's probably is a "if (! response.isEnded())" missing.

@lrotim
Copy link
Author

lrotim commented Apr 12, 2021

That's probably is a "if (! response.isEnded())" missing.

What do you mean by that? Missing as-if in quarkus source code?

This kind of error also appear when using http2 in prod mode in specific situations - for example if I have any kind of 'filter' route in front of 'final route' that expects to use request Body
I can add such minimal example as well under new issue

@cescoffier
Copy link
Member

Yes please add a reproducer. And yes the missing code is in Quarkus.

stuartwdouglas added a commit to stuartwdouglas/quarkus that referenced this issue Apr 13, 2021
@quarkus-bot quarkus-bot bot added this to the 2.0 - main milestone Apr 13, 2021
@gsmet gsmet modified the milestones: 2.0 - main, 1.13.2.Final Apr 13, 2021
gsmet pushed a commit to gsmet/quarkus that referenced this issue Apr 13, 2021
Fixes quarkusio#16170

(cherry picked from commit a071f84)
DavideD pushed a commit to DavideD/quarkus that referenced this issue Apr 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devmode kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants