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

WebSocket Next Server-Side Streaming cancelation #41025

Closed
andlinger opened this issue Jun 6, 2024 · 1 comment · Fixed by #41044
Closed

WebSocket Next Server-Side Streaming cancelation #41025

andlinger opened this issue Jun 6, 2024 · 1 comment · Fixed by #41044
Assignees
Labels
area/websockets kind/bug Something isn't working
Milestone

Comments

@andlinger
Copy link
Contributor

andlinger commented Jun 6, 2024

Describe the bug

If a server-side streaming connection is closed by the client, the subscription of Multi should also be cancelled.

@WebSocket(path = "/v1/products")
@RequestScoped
public class ProductSocket {

    @OnOpen
    public Multi<Product> onOpen() {
        return Multi.createFrom()
                .ticks()
                .every(Duration.ofSeconds(2))
                .map(aLong -> new Product(String.valueOf(aLong)));
    }
}

Expected behavior

The returned Multi<Product> should be cancelled if the client closes the WebSocket connection.

Actual behavior

The Mutli<Product> subscription stays active and produces following exceptions every tick:

2024-06-06 13:20:07,851 ERROR [io.qua.web.nex.run.WebSocketEndpointBase] (executor-thread-1) Unable to send text message from Multi: WebSocket connection [id=13bedb47-618f-4631-9a5a-164807c53572, path=/v1/products]: io.vertx.core.impl.NoStackTraceThrowable: WebSocket is closed

How to Reproduce?

Created a reproducer: https://github.com/andlinger/quarkus-reproducer/tree/quarkus-41025

@andlinger andlinger added the kind/bug Something isn't working label Jun 6, 2024
@andlinger andlinger changed the title WebSocket Next Server-Side Streaming canceling WebSocket Next Server-Side Streaming cancelation Jun 6, 2024
@geoand
Copy link
Contributor

geoand commented Jun 6, 2024

cc @mkouba

@mkouba mkouba self-assigned this Jun 6, 2024
mkouba added a commit to mkouba/quarkus that referenced this issue Jun 7, 2024
mkouba added a commit to mkouba/quarkus that referenced this issue Jun 7, 2024
@mkouba mkouba moved this to In Progress in WG - WebSocket Next Jun 7, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in WG - WebSocket Next Jun 11, 2024
@quarkus-bot quarkus-bot bot added this to the 3.12 - main milestone Jun 11, 2024
@gsmet gsmet modified the milestones: 3.12 - main, 3.11.2 Jun 11, 2024
gsmet pushed a commit to gsmet/quarkus that referenced this issue Jun 11, 2024
holly-cummins pushed a commit to holly-cummins/quarkus that referenced this issue Jul 31, 2024
danielsoro pushed a commit to danielsoro/quarkus that referenced this issue Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/websockets kind/bug Something isn't working
Projects
Development

Successfully merging a pull request may close this issue.

4 participants