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

[BUG] potential ConcurrentModificationException when removeQueue #1197

Open
HScarb opened this issue Apr 15, 2024 · 0 comments
Open

[BUG] potential ConcurrentModificationException when removeQueue #1197

HScarb opened this issue Apr 15, 2024 · 0 comments
Labels

Comments

@HScarb
Copy link

HScarb commented Apr 15, 2024

Describe the bug

public void removeQueue(AmqpQueue queue) {
queues.remove(queue);
if (exchangeType == Type.Direct) {
for (Map.Entry<String, Set<AmqpQueue>> entry : bindingKeyQueueMap.entrySet()) {
bindingKeyQueueMap.computeIfPresent(entry.getKey(), (k, v) -> {
v.remove(queue);
if (v.isEmpty()) {
return null;
}
return v;
});
}
}
updateExchangeProperties();
deleteCursor(queue.getName());
}

in removeQueue method, we remove value from a map when iterating it, which cause potential ConcurrentModificationException.

To Reproduce
bind queue with Direct exchange, then remove the queue

Expected behavior
queue removed successfully

Screenshots
none

Additional context
none

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

No branches or pull requests

1 participant