incubator-cassandra-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Ellis <jbel...@gmail.com>
Subject Re: ConcurrentModificationException on boot
Date Fri, 18 Jan 2013 00:17:12 GMT
You're right.

Created CASSANDRA-5170 and attached a patch switching to ConcurrentHashMap.

On Thu, Jan 17, 2013 at 5:44 PM, Kirk True <kirk@mustardgrain.com> wrote:
> Hi all,
>
>
>
> A client is using Cassandra 1.2.0 (embedded) into their system. On
> startup of one of the nodes in the system, they're seeing a
> ConcurrentModificationException:
>
>
>
> java.util.ConcurrentModificationException
>
> at java.util.HashMap$HashIterator.nextEntry(HashMap.java:810)
>
> at java.util.HashMap$KeyIterator.next(HashMap.java:845)
>
> at
> org.apache.cassandra.dht.BootStrapper.getBootstrapSource(BootStrapper.j
> ava:146)
>
> at
> org.apache.cassandra.dht.BootStrapper.getBalancedToken(BootStrapper.jav
> a:135)
>
> at
> org.apache.cassandra.dht.BootStrapper.getBootstrapTokens(BootStrapper.j
> ava:115)
>
> at
> org.apache.cassandra.service.StorageService.joinTokenRing(StorageServic
> e.java:611)
>
> at
> org.apache.cassandra.service.StorageService.initServer(StorageService.j
> ava:499)
>
> at
> org.apache.cassandra.service.StorageService.initServer(StorageService.j
> ava:397)
>
> at
> org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java
> :309)
>
> at
> org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.j
> ava:397)
>
> at CassandraServer.start(CassandraServer.java:415)
>
>
>
> LoadBroadcaster has an internal map named loadInfo that it both
> modifies internally as well as makes available via an accessor method
> (getLoadInfo).
>
>
>
> StorageService.joinTokenRing contains this line (611):
>
>
>
>     tokens = BootStrapper.getBootstrapTokens(tokenMetadata,
> LoadBroadcaster.instance.getLoadInfo());
>
>
>
> So that's how BootStrapper gets access to LoadBroadcaster's loadInfo.
>
>
>
> There are a few places where LoadBroadcaster is called by Gossiper to
> add and remove nodes which then modifies loadInfo. There's no logging
> in many of those places, so it's hard to know which one it is.
>
>
>
> Should LoadBroadcaster.instance.getLoadInfo() return a copy of the
> internal map rather than just a reference to it?
>
>
>
> Thanks,
>
> Kirk



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder, http://www.datastax.com
@spyced

Mime
View raw message