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

Resteasy mutiny : multi subscription not cancelled if the request is cancelled from browser. #13988

Closed
samar-fission opened this issue Dec 19, 2020 · 7 comments · Fixed by #14119
Labels
Milestone

Comments

@samar-fission
Copy link

Describe the bug
When using resteasy with mutiny, I am sending an infinite stream as output and have opened the endpoint in the browser
http://localhost:8080/block/test
After some time I have cancelled the request from browser but the server is still generating data. I am very new to Quarkus and testing out stuff, please correct if I am doing anything wrong. Please check the screenshot for the dependencies used.

@Path("/")
public class ReactiveGreetingResource 
{

    @Inject
    ReactiveGreetingService service;

    private static final Logger LOG = Logger.getLogger(ReactiveGreetingResource.class);

    @GET
    @Produces(MediaType.TEXT_PLAIN)
    @Path("block/{name}")
    public Multi<Long> greeting(@PathParam String name) {
        return Multi.createFrom().ticks().every(
  			  
  			  Duration.ofSeconds(2)).invoke(x -> {
  				  
  				  LOG.info(Thread.currentThread().getName() + "-" + new Date().getSeconds());});
    }

}

Expected behavior
Multi should stop generating data if the request is cancelled. The subscription should be cancelled on request cancel.

Actual behavior
Multi is still generating data even though the request is cancelled.

Screenshots
Screenshot from 2020-12-20 00-27-32

Environment (please complete the following information):

  • Output of uname -a or ver:
  • Output of java -version: 11
  • GraalVM version (if different from Java): 20.3.0.r11-grl
  • Quarkus version or git rev: 1.10.3.Final
  • Build tool (ie. output of mvnw --version or gradlew --version):
Apache Maven 3.6.0
Maven home: /usr/share/maven
Java version: 11.0.9, vendor: GraalVM Community, runtime: .sdkman/candidates/java/20.3.0.r11-grl
Default locale: en_IN, platform encoding: UTF-8
OS name: "linux", version: "5.3.0-46-generic", arch: "amd64", family: "unix"

@samar-fission samar-fission added the kind/bug Something isn't working label Dec 19, 2020
@ghost
Copy link

ghost commented Dec 19, 2020

/cc @cescoffier, @jponge

@geoand
Copy link
Contributor

geoand commented Dec 21, 2020

cc @FroMage

@FroMage
Copy link
Member

FroMage commented Jan 5, 2021

I can confirm this bug.

@FroMage
Copy link
Member

FroMage commented Jan 8, 2021

Hold on, was this for RESTEasy or RESTEasy Reactive? I only fixed it for the latter.

@samar-fission
Copy link
Author

Hold on, was this for RESTEasy or RESTEasy Reactive? I only fixed it for the latter.

@FroMage I am using below dependencies.. i have checked with 1.13.6.Final, the issue still exists..

<dependency>
  <groupId>io.rest-assured</groupId>
  <artifactId>rest-assured</artifactId>
  <scope>test</scope>
</dependency>
 <dependency>
  <groupId>org.jboss.logmanager</groupId>
  <artifactId>log4j2-jboss-logmanager</artifactId> 
</dependency>
<dependency>
  <groupId>io.quarkus</groupId>
  <artifactId>quarkus-resteasy-mutiny</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-vertx-web</artifactId>

@angelo147
Copy link

+1 from me. Issues still exists for RESTEasy.

@scharalabos
Copy link

issue still exists in RESTEasy but in RESTEasy Reactive is fixed, if you can fix it also for RESTEasy it will be perfect!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants