`RabbitMQClient` allows multiple simultaneous calls to `start()`
kdubb opened this issue · 1 comments
Questions
Do not use this issue tracker to ask questions, instead use one of these channels. Questions will likely be closed without notice.
Version
Which version(s) did you encounter this bug ? 4.1.4
Context
I encountered a ConcurrentModificationException
during connect while ... using SmallRye Reactive Messaging with the RabbitMQ connector.
SmallRye Messaging has a buggy caching code that allows RabbitMQClient.start()
to be called multiple times concurrently; see the bug here and the proposed fix here.
RabbitMQClientImpl
allows the start
requests to continue and calls it's private connect()
method for each start request. Ultimately because multiple connect attempts are completing concurrently a ConcurrentModificationException
is throws due to them each attempting iterate/modify RabbitMQClientImpl.connectionEstablishedCallbacks
.
Do you have a reproducer?
I've added a reproducer that shows RabbitMQClient allows multiple concurrent calls to start()
. Unfortunately I'm having trouble reproducing the ConcurrentModificationException.
Steps to reproduce
- Create a
RabbitMQClient
2.Call start multiple times
Extra
- Anything that can be relevant such as OS version, JVM version
macOS, JVM 17
I've changed the repro to show that you can start
a client 10 times and then stop
it and on server shutdown you'll receive 9 reconnection messages. The messages are from orphaned connection objects that were incorrectly created.