-
Notifications
You must be signed in to change notification settings - Fork 95
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
ConcurrentModificationException in subscriber callbacks when using exactly-once-delivery #1778
Comments
Today I verified that the latest version of the library that did not include the linked PR (version 1.124.2) has no soft-crash issues (and no concurrent-modification issue, duh). Since the soft-crashes can't be detected without monitoring the amount of messages received and knowing the expected number, I would say this issue is quite critical to fix. The old version also seems to perform better (based on my minimal testing). Publishing 50 small messages per second and consuming them via 5 threads on my local machine generates no surplus with the old version, while the new one easily generates 1000s of messages more than it consumes on average. I've not done extensive performance testing though since the subscribers usually stop too early with the new version, so it's possible this is not true hadn't the subscribers been soft-crashing. |
tried this setup last night, and was able to see this error:
I tried adding the keyword 'synchronized' to the processReceivedMessages(), and was able to confirm that this error does not show up anymore. I will make a PR regarding this |
@maitrimangal Yes that error also shows up a lot, but isn't as critical to fix. But adding |
Please reopen if the above PR does not fix the issue. |
@maitrimangal Maybe time to do a release so that we can try it out? Is there something blocking? |
Have merged in the new release. Let me know if this solves the problem! |
The issue is solved from what I can see, thanks. |
Description
This recently merged PR introduces a concurrent-modification exception when exactly-once-delivery is enabled. I believe the source is this unsynchronized call, as all other usages seem to be synchronized.
I've also noticed that the subscriber often stops processing messages completely shortly after this is thrown (usually the 2nd or 3rd time the exception is thrown), which makes this even more critical to fix. I've not fully verified why the subscriber completely stops processing messages (it's still considered in a running state at the top-level, maybe the cause would be messages sitting in-memory but not getting sent to the user to ack / nack 🤷 ), so it's possible the soft-crashes are caused by something else - but the pattern is very consistent.
Environment details
Tested using library version 1.125.6, Java 17.
Steps to reproduce
Stack trace
The text was updated successfully, but these errors were encountered: