Skip to content

Fix race condition in the DelayHandler #8894

Closed
@artembilan

Description

@artembilan

The access to MessageGroup and its collection of messages must be exclusive to produce consistent results.
Otherwise it fails like sporadically:

Caused by: java.util.ConcurrentModificationException: (No message provided)	
	at java.util.LinkedHashMap$LinkedHashIterator.nextNode(LinkedHashMap.java:756)	
	at java.util.LinkedHashMap$LinkedKeyIterator.next(LinkedHashMap.java:778)	
	at java.util.Iterator.forEachRemaining(Iterator.java:133)	
	at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1845)	
	at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)	
	at org.springframework.integration.handler.DelayHandler.reschedulePersistedMessages(DelayHandler.java:600)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions