Protect sendHeartbeat from cancellation

Issue: SPR-14564
This commit is contained in:
Rossen Stoyanchev
2016-08-08 17:33:57 -04:00
parent 5c8573233a
commit 977b67e418
2 changed files with 4 additions and 0 deletions

0
change.diff Normal file
View File

View File

@@ -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();
}