SockJs heartbeat causes deadlock with XHR polling [SPR-14833] #19399
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: backported
An issue that has been backported to maintenance branches
type: bug
A general bug
Milestone
Grégory Coutant opened SPR-14833 and commented
When using XHR polling as a transport for SockJs, a deadlock can occur when one thread is sending a message at the same time the heartbeat run.
Stack from thread sending a message :
Heartbeat task :
Looking at the code, there seem to be two locks : heartbeatLock in AbstractSockJsSession and responseLock in AbstractHttpSockJsSession. When calling sendMessage(), the lock order is responseLock then heartbeatLock. For the HeartbeatTask, the lock order is heartbeatLock then responseLock.
Affects: 4.2.8, 4.3.3
Issue Links:
Referenced from: commits 72e1f7e, 1c80d2a, 4ce0e6b
Backported to: 4.2.9
The text was updated successfully, but these errors were encountered: