You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During invocation of SimpMessageSendingOperations::convertAndSend method ConcurrentModificationException occures. It happens very rarely (I found out about this bug by checking logs from production, I haven't seen it in application), probably when invocation of this method happens simultaneously with closing webSocket on a client.
Here's a stack:
org.springframework.messaging.MessageDeliveryException: Failed to handle message to ExecutorSubscribableChannel[brokerChannel] in SimpleBroker[DefaultSubscriptionRegistry[cache[2 destination(s)], registry[2 sessions]]]; nested exception is java.util.ConcurrentModificationException
at org.springframework.messaging.support.ExecutorSubscribableChannel$SendTask.run(ExecutorSubscribableChannel.java:180) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE]
at org.springframework.messaging.support.ExecutorSubscribableChannel.sendInternal(ExecutorSubscribableChannel.java:93) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE]
at org.springframework.messaging.support.AbstractMessageChannel.send(AbstractMessageChannel.java:107) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE]
at org.springframework.messaging.support.AbstractMessageChannel.send(AbstractMessageChannel.java:94) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE]
at org.springframework.messaging.simp.SimpMessagingTemplate.sendInternal(SimpMessagingTemplate.java:185) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE]
at org.springframework.messaging.simp.SimpMessagingTemplate.doSend(SimpMessagingTemplate.java:160) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE]
at org.springframework.messaging.simp.SimpMessagingTemplate.doSend(SimpMessagingTemplate.java:47) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE]
at org.springframework.messaging.core.AbstractMessageSendingTemplate.send(AbstractMessageSendingTemplate.java:95) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE]
at org.springframework.messaging.core.AbstractMessageSendingTemplate.convertAndSend(AbstractMessageSendingTemplate.java:133) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE]
at org.springframework.messaging.core.AbstractMessageSendingTemplate.convertAndSend(AbstractMessageSendingTemplate.java:113) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE]
at org.springframework.messaging.core.AbstractMessageSendingTemplate.convertAndSend(AbstractMessageSendingTemplate.java:108) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE]
at
.... [our application stack leading to convertAndSend on SimpMessageSendingOperations object]
Caused by: java.util.ConcurrentModificationException: null
at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(LinkedHashMap.java:394) ~[na:1.7.0_55]
at java.util.LinkedHashMap$KeyIterator.next(LinkedHashMap.java:405) ~[na:1.7.0_55]
at org.springframework.messaging.simp.broker.SimpleBrokerMessageHandler.sendMessageToSubscribers(SimpleBrokerMessageHandler.java:227) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE]
at org.springframework.messaging.simp.broker.SimpleBrokerMessageHandler.handleMessageInternal(SimpleBrokerMessageHandler.java:183) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE]
at org.springframework.messaging.simp.broker.AbstractBrokerMessageHandler.handleMessage(AbstractBrokerMessageHandler.java:180) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE]
at org.springframework.messaging.support.ExecutorSubscribableChannel$SendTask.run(ExecutorSubscribableChannel.java:172) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE]
... 24 common frames omitted
Although DefaultSubscriptionRegistry maintained separate "update" and "access" caches to ensure that findSubscriptions returns a safe to iterate map, there was a bug in the addSubscriptions method that mistakenly used the original map for the "update" cache. This has been fixed.
Piotr Leśniak opened SPR-12665 and commented
During invocation of SimpMessageSendingOperations::convertAndSend method ConcurrentModificationException occures. It happens very rarely (I found out about this bug by checking logs from production, I haven't seen it in application), probably when invocation of this method happens simultaneously with closing webSocket on a client.
Here's a stack:
Can it be related to this #16377 bug?
Affects: 4.1 GA
Issue Links:
The text was updated successfully, but these errors were encountered: