Description
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:
- [docs] Document the need for periodic writes on a streaming response [SPR-16494] #21037 [docs] Document the need for periodic writes on a streaming response
- Disconnected client exception logging should differentiate remote service exceptions too [SPR-17341] #21875 Disconnected client exception logging should differentiate remote service exceptions too