Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RabbitMQClient allows multiple simultaneous calls to start() #141

Open
kdubb opened this issue Oct 8, 2021 · 1 comment
Open

RabbitMQClient allows multiple simultaneous calls to start() #141

kdubb opened this issue Oct 8, 2021 · 1 comment
Labels

Comments

@kdubb
Copy link
Contributor

kdubb commented Oct 8, 2021

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

  1. Create a RabbitMQClient
    2.Call start multiple times

starter.zip

Extra

  • Anything that can be relevant such as OS version, JVM version

macOS, JVM 17

@kdubb kdubb added the bug label Oct 8, 2021
@kdubb
Copy link
Contributor Author

kdubb commented Oct 8, 2021

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.

starter.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant