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
java.util.ConcurrentModificationException: null when testing with ~10 concurrent users #3293
Comments
@johannest will provide load scripts in the ticket in a short while so that we can try to reproduce it ourselves. |
Gatling test script attached: |
Thanks! |
Run the test by
|
Quickly looking code this happens probably because pendingChangeEvents list in MapSyncRpcHandler is modified while flushPendingChangeEvents is run OR flushPendingChangeEvents is called again before it is finished. |
As a workaround simply synchronizing the access to the pendingChangeEvents list seems to fix the issue. But synchronizing might cause some other issues such as deadlocks.. |
Synchronizing in each way? We have internal lock on the session which technically should be taken each time when we handle the request unless it's very special request which has to be handled without the lock and it this case it should care about synchronization by itself. I was pretty sure that all our handlers are executed under the session lock. |
I just tried naively adding synchronized block around pendingChangeEvents.add and iteration+clearing of the list. It seemed to "fix" the issue. I realise that this is not valid fix but more like a workaround. |
Apparently it is not enough to synchronize the content of flushPendingChangeEvents, thus I suppose that the problem is that pendingChangeEvents.add(changeEventRunnable); is called while the pendingChangeEvents is iterated in the flushPendingChangeEvents method. |
OK, thanks, good to know. |
@johannest commented on Thu Jan 11 2018
Bakery load testing with Gatling. When the concurrent user count reaches 5-10 users the exception below starts appearing.
Test scenario
Exception is got quite randomly from different places of the above scenario, e.g. after 3. or when inputing user's name etc.
The text was updated successfully, but these errors were encountered: