mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-10-03 13:39:34 +00:00
Protect sendHeartbeat from cancellation
Issue: SPR-14564
This commit is contained in:
+4
@@ -252,6 +252,10 @@ public abstract class AbstractSockJsSession implements SockJsSession {
|
||||
if (isActive()) {
|
||||
if (heartbeatLock.tryLock()) {
|
||||
try {
|
||||
if (this.heartbeatTask == null) {
|
||||
// Cancelled while waiting to acquire the lock
|
||||
return;
|
||||
}
|
||||
writeFrame(SockJsFrame.heartbeatFrame());
|
||||
scheduleHeartbeat();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user