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

Prevent accumulation of cancelled SockJS heartbeat tasks [SPR-11918] #16537

spring-projects-issues opened this issue Jun 25, 2014 · 0 comments
in: web type: bug


Copy link

@spring-projects-issues spring-projects-issues commented Jun 25, 2014

Rossen Stoyanchev opened SPR-11918 and commented

From the Javadoc of java.util.concurrent.ScheduledThreadPoolExecutor:

"... a cancelled task is not automatically removed from
the work queue until its delay elapses. While this enables further
inspection and monitoring, it may also cause unbounded retention of
cancelled tasks. To avoid this, set setRemoveOnCancelPolicy to true,
which causes tasks to be immediately removed from the work queue at
time of cancellation."

Under sustained high load, a large number of tasks can accumulate leading to the "unbounded retention of cancelled tasks" mentioned in the Javadoc.

Note that when using STOMP messaging, after STOMP-level heartbeats are successfully negotiated, the SockJS heartbeats are suppressed. Hence this is only an issue if using the simple broker, or not using STOMP, or using a STOMP client that doesn't support heartbeats (e.g. simple test client) or has them explicitly disabled through the STOMP CONNECT frame header.

Affects: 4.0.5

Issue Links:

  • #16852 WebSocketMessageBrokerConfigurationSupport requiring JDK 7+ due to setRemoveOnCancelPolicy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
in: web type: bug
None yet

No branches or pull requests

2 participants