-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
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:
- WebSocketMessageBrokerConfigurationSupport requiring JDK 7+ due to setRemoveOnCancelPolicy [SPR-12238] #16852 WebSocketMessageBrokerConfigurationSupport requiring JDK 7+ due to setRemoveOnCancelPolicy