Issue Details (XML | Word | Printable)

Key: NUCCORE-559
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Erik Bengtson
Reporter: Bennie Schut
Votes: 0
Watchers: 1

If you were logged in you would be able to see more operations.
DataNucleus Core

Concurrency Bug: unsynchronized WeakHashMap in

Created: 02/Sep/10 07:00 AM   Updated: 20/Oct/10 09:29 AM   Resolved: 12/Sep/10 10:25 AM
Component/s: None
Affects Version/s: 2.0.3
Fix Version/s: 2.2.0.m2

File Attachments: 1. Text File NUCCORE-559-1.patch (1 kB)

 Description  « Hide
Somewhat similar story as NUCCORE-553. We have hanging threads using 100% cpu.
Is it allowed to have multiple threads calling the JDOClassLoaderResolver? Since it's using the non threadsafe WeakValueMap on the offending code.

"pool-1-thread-41" prio=10 tid=0x00007fb60bc5b800 nid=0x63a2 runnable [0x0000000040f75000]
   java.lang.Thread.State: RUNNABLE
        at java.util.HashMap.get(
        at org.datanucleus.util.ReferenceValueMap.get(
        at org.datanucleus.JDOClassLoaderResolver.classForName(
        at org.datanucleus.JDOClassLoaderResolver.classForName(
        - locked <0x0000000783023778> (a
        at org.datanucleus.sco.SCOUtils.populateMapDelegateWithStoreData(
        at org.datanucleus.sco.backed.Map.loadFromStore(
        at org.datanucleus.sco.backed.Map.load(
        at org.datanucleus.state.JDOStateManagerImpl.loadUnloadedFields(
        at org.datanucleus.jdo.state.Hollow.transitionRetrieve(
        at org.datanucleus.state.AbstractStateManager.retrieve(
        at org.datanucleus.ObjectManagerImpl.retrieveObject(
        at org.datanucleus.jdo.JDOPersistenceManager.jdoRetrieve(
        at org.datanucleus.jdo.JDOPersistenceManager.retrieve(
        - locked <0x0000000782a57bb8> (a org.datanucleus.jdo.JDOPersistenceManager)
        at org.datanucleus.jdo.JDOPersistenceManager.retrieve(
        - locked <0x0000000782a57bb8> (a org.datanucleus.jdo.JDOPersistenceManager)
        at org.apache.hadoop.hive.metastore.ObjectStore.getMTable(

Bennie Schut added a comment - 03/Sep/10 07:03 AM
Using Collections.synchronizedMap solved this problem for us. Just added a patch as example.

Bennie Schut made changes - 03/Sep/10 07:03 AM
Field Original Value New Value
Attachment NUCCORE-559-1.patch [ 11244 ]
Erik Bengtson added a comment - 12/Sep/10 10:25 AM
thanks for the patch

Erik Bengtson made changes - 12/Sep/10 10:25 AM
Status Open [ 1 ] Resolved [ 5 ]
Assignee Erik Bengtson [ erik ]
Fix Version/s 2.2.0.m2 [ 11022 ]
Resolution Fixed [ 1 ]
Andy Jefferson made changes - 20/Oct/10 09:29 AM
Status Resolved [ 5 ] Closed [ 6 ]