Skip to content

WebFlux SSE controller does not detect disconnected client [SPR-15306] #18523

Closed
@spring-projects-issues

Description

@spring-projects-issues

Sergei Egorov opened SPR-15306 and commented

Spring SSE implementation doesn't cancel the subscription when the client disconnects but waits until the next failed emission.

It leads to a huge number of open subscriptions when notification rarely happens (i.e. Stocks SSE endpoint with a non-frequently changing stock value).

Reference URL contains a Gist with Groovy app demonstrating an issue.
Start an app, use "curl -v localhost:8080", "CTRL-C". The app will continue to log because "distinctUntilChanged()" doesn't trigger anything, but the subscription is not canceled�.

Critical because if subscription is not lightweight (i.e. polling, or distributed event listening, pub/sub) server's performance quickly goes down and can be DoS'ed by hitting SSE endpoint


Affects: 5.0 M5

Reference URL: https://gist.github.com/bsideup/c69cd2395996adb246639eef43098343

Issue Links:

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions