Forum Stats

  • 3,851,525 Users
  • 2,263,993 Discussions


A creation of ReplicatedEnvironment can hang on initialization of TupleBinding/IntegerBinding when a

User_BZQZ5 Member Posts: 16 Blue Ribbon
edited Feb 15, 2019 8:05AM in Berkeley DB Java Edition


When 2 BDB JE environments (one replicated and another non-replicated) co-exist in the same JVM, the creation of replicated environment can hang occasionally.

The BDB JE environments are create in parallel threads.The issue was reported couple of times to me. A thread-dump was collected last time.

In the thread dump I could see that hanging happened on initialization of class "com.sleepycat.bind.tuple.TupleBinding" as below:

at com.sleepycat.bind.tuple.TupleBinding.<clinit>(    at    -  locked [email protected]    at    at    -  locked [email protected]    at    at    at<init>(    at<init>(    at<init>(    at<init>(

At line 53 of TupleBinding an instance of IntegerBindin is created and added into HashMap:

        addPrimitive(Integer.class, Integer.TYPE, new IntegerBinding());

The other non-replicated environment instance was successfully created, however, the hung for this environment happened at the same time on invocation of BDB JE static method IntegerBinding.entryToInt(key).

The code where hanging happened looks like the one below

  DatabaseEntry key = new DatabaseEntry();  DatabaseEntry value = new DatabaseEntry();  while(cursor.getNext(key, value, null) == OperationStatus.SUCCESS)  {      int i = IntegerBinding.entryToInt(key); // <!--- hang at this line...

It looks like a bizarre classloader issue to me. Perhaps, it would be better to raise a defect against JDK, but, before taking that route, I would like to clarify, whether anyone else experienced something similar. If so, is there is any way to work around it?

Th bdb je version in use is 7.4.5.

Here are some details of environments where issues happened.

JVM: Oracle Corporation, version: 1.8.0_144-b01, OS: Linux version: 2.6.18-423.el5, architecture: amd64, cores: 64

JVM: Oracle Corporation, version: 1.8.0_161-b12, OS: Linux version: 3.10.0-514.6.1.el7.x86_64, architecture: amd64, cores: 40

Please note that the reported issue occurs on application startup. The JVMs seem were not in any stress...

Kind Regards,