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

Quarkus Resteasy Reactive does not respect keep-alive when using Multi<>s #18445

Closed
rasmusfaber opened this issue Jul 6, 2021 · 2 comments · Fixed by #18470
Closed

Quarkus Resteasy Reactive does not respect keep-alive when using Multi<>s #18445

rasmusfaber opened this issue Jul 6, 2021 · 2 comments · Fixed by #18470
Labels
area/resteasy-reactive kind/bug Something isn't working
Milestone

Comments

@rasmusfaber
Copy link

Describe the bug

Quarkus Resteasy Reactive kills connections even if Connection: keep-alive is specified and acknowledged by the server.

The problem only occurs when returning Multi<>s, not when returning Uni<>s or synchronous results.

A simple method such as

    @GET
    public Multi<String> async(){
        return Multi.createFrom().item("async");
    }

and then calling

curl http://localhost:8080 http://localhost:8080 -v -H "Connection: keep-alive

reproduces the problem.

Expected behavior

Quarkus Resteasy Reactive should behave like non-reactive and keep the connection alive.

Actual behavior

The connection is dead after the first request.

To Reproduce

Small project based on the Quarkus Reactive quick-start.

https://github.com/rasmusfaber/quarkus-resteasy-reactive-connection-drop

Steps to reproduce the behavior:

  1. Run the included tests and notice that testHelloEndpointAsyncMulti fails.
    Or
  2. Build and start the application
  3. Run curl http://localhost:8081/hello/async http://localhost:8081/hello/async -v -H "Connection: keep-alive"
  4. Notice that the second connection fails and curl needs to create a new connection (compare with curl http://localhost:8081/hello/sync http://localhost:8081/hello/sync -v -H "Connection: keep-alive")

Environment (please complete the following information):

Output of uname -a or ver

Linux xxx 5.4.0-73-generic #82~18.04.1-Ubuntu SMP Fri Apr 16 15:10:02 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

openjdk version "15.0.2" 2021-01-19
OpenJDK Runtime Environment AdoptOpenJDK (build 15.0.2+7)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 15.0.2+7, mixed mode, sharing)

Quarkus version or git rev

2.0.0.Final (also 1.13.3.Final)

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

apache-maven-3.6.3

@rasmusfaber rasmusfaber added the kind/bug Something isn't working label Jul 6, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Jul 6, 2021

/cc @FroMage, @geoand, @stuartwdouglas

@rasmusfaber
Copy link
Author

I guess it is because of this line:

The connection isn't closed when returning an Uni<>.

stuartwdouglas added a commit to stuartwdouglas/quarkus that referenced this issue Jul 6, 2021
stuartwdouglas added a commit to stuartwdouglas/quarkus that referenced this issue Jul 8, 2021
stuartwdouglas added a commit to stuartwdouglas/quarkus that referenced this issue Jul 12, 2021
@quarkus-bot quarkus-bot bot added this to the 2.1 - main milestone Jul 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/resteasy-reactive kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant