# ConcurrentModificationException

**URL:** <https://discuss.elastic.co/t/concurrentmodificationexception/4391>\
**Category:** Elasticsearch\
**Created:** [May 12, 2011, 3:27pm UTC](https://discuss.elastic.co/t/concurrentmodificationexception/4391 "2011-05-12T15:27:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karussell1](https://avatars.discourse-cdn.com/v4/letter/k/50afbb/32.png) [@Karussell1](https://discuss.elastic.co/u/Karussell1)\
**Post date:** [May 12, 2011, 3:27pm UTC](https://discuss.elastic.co/t/concurrentmodificationexception/4391/1 "2011-05-12T15:27:02Z")

</div>

I got the following exception several times 3 minutes after starting  
the node:

[elasticsearch[Zuras]clusterService#updateTask-pool-11-thread-1] WARN  
org.elasticsearch.cluster.service - [Zuras] failed to execute cluster  
state update, state:  
version [2789], source [routing-table-updater]  
nodes:  
[Chemistro][Gd7\_Hzq1SOyq-0CNQkO-FQ][inet[/127.0.0.1:9304]]  
[Mass Master][OE7HPdccSQKF3Nv9RB01NA][inet[/127.0.0.1:9301]]  
[Zuras][4u7Pzq4mR6yBZEH7JGTYYw][inet[/127.0.0.1:9300]], local,  
master  
[Centurion][CAmAVyv0QyytFasDxIZfQA][inet[/127.0.0.1:9302]]  
routing\_table:  
-- index [articleindex]  
----shard\_id [articleindex][0]  
....  
...  
java.util.ConcurrentModificationException  
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:793)  
at java.util.HashMap$KeyIterator.next(HashMap.java:828)  
at  
org.elasticsearch.gateway.local.LocalGatewayNodeAllocation.buildShardStores(LocalGatewayNodeAllocation.java:  
353)  
at  
org.elasticsearch.gateway.local.LocalGatewayNodeAllocation.allocateUnassigned(LocalGatewayNodeAllocation.java:  
213)  
at  
org.elasticsearch.cluster.routing.allocation.NodeAllocations.allocateUnassigned(NodeAllocations.java:  
80)  
at  
org.elasticsearch.cluster.routing.allocation.ShardsAllocation.reroute(ShardsAllocation.java:  
147)  
at  
org.elasticsearch.cluster.routing.allocation.ShardsAllocation.reroute(ShardsAllocation.java:  
99)  
at org.elasticsearch.cluster.routing.RoutingService  
$RoutingTableUpdater$1.execute(RoutingService.java:124)  
at org.elasticsearch.cluster.service.InternalClusterService  
$2.run(InternalClusterService.java:175)  
at java.util.concurrent.ThreadPoolExecutor  
$Worker.runTask(ThreadPoolExecutor.java:886)  
at java.util.concurrent.ThreadPoolExecutor  
$Worker.run(ThreadPoolExecutor.java:908)  
at java.lang.Thread.run(Thread.java:662)

Using 0.16 here.

Regards,  
Peter.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 12, 2011, 3:29pm UTC](https://discuss.elastic.co/t/concurrentmodificationexception/4391/2 "2011-05-12T15:29:22Z")

</div>

Heya,

Already fixed in master and upcoming 0.16.1 (which will be released today).

-shay.banon  
On Thursday, May 12, 2011 at 6:27 PM, Karussell wrote:

> I got the following exception several times 3 minutes after starting  
> the node:
> 
> [elasticsearch[Zuras]clusterService#updateTask-pool-11-thread-1] WARN  
> org.elasticsearch.cluster.service - [Zuras] failed to execute cluster  
> state update, state:  
> version [2789], source [routing-table-updater]  
> nodes:  
> [Chemistro][Gd7\_Hzq1SOyq-0CNQkO-FQ][inet[/127.0.0.1:9304]]  
> [Mass Master][OE7HPdccSQKF3Nv9RB01NA][inet[/127.0.0.1:9301]]  
> [Zuras][4u7Pzq4mR6yBZEH7JGTYYw][inet[/127.0.0.1:9300]], local,  
> master  
> [Centurion][CAmAVyv0QyytFasDxIZfQA][inet[/127.0.0.1:9302]]  
> routing\_table:  
> -- index [articleindex]  
> ----shard\_id [articleindex][0]  
> ....  
> ...  
> java.util.ConcurrentModificationException  
> at java.util.HashMap$HashIterator.nextEntry(HashMap.java:793)  
> at java.util.HashMap$KeyIterator.next(HashMap.java:828)  
> at  
> org.elasticsearch.gateway.local.LocalGatewayNodeAllocation.buildShardStores(LocalGatewayNodeAllocation.java:  
> 353)  
> at  
> org.elasticsearch.gateway.local.LocalGatewayNodeAllocation.allocateUnassigned(LocalGatewayNodeAllocation.java:  
> 213)  
> at  
> org.elasticsearch.cluster.routing.allocation.NodeAllocations.allocateUnassigned(NodeAllocations.java:  
> 80)  
> at  
> org.elasticsearch.cluster.routing.allocation.ShardsAllocation.reroute(ShardsAllocation.java:  
> 147)  
> at  
> org.elasticsearch.cluster.routing.allocation.ShardsAllocation.reroute(ShardsAllocation.java:  
> 99)  
> at org.elasticsearch.cluster.routing.RoutingService  
> $RoutingTableUpdater$1.execute(RoutingService.java:124)  
> at org.elasticsearch.cluster.service.InternalClusterService  
> $2.run(InternalClusterService.java:175)  
> at java.util.concurrent.ThreadPoolExecutor  
> $Worker.runTask(ThreadPoolExecutor.java:886)  
> at java.util.concurrent.ThreadPoolExecutor  
> $Worker.run(ThreadPoolExecutor.java:908)  
> at java.lang.Thread.run(Thread.java:662)
> 
> Using 0.16 here.
> 
> Regards,  
> Peter.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 4:06am UTC](https://discuss.elastic.co/t/concurrentmodificationexception/4391/3 "2017-07-06T04:06:22Z")

</div>


