aerospike / aerospike-client-java

Aerospike Java Client Library
Other
236 stars 212 forks source link

Aerospike client infinite timeout #199

Closed monrealis closed 2 years ago

monrealis commented 3 years ago

It seems that Aerospike client sometimes does not timeout operations.

This query was hanging for over a day.

"Thread-6" #18 daemon prio=5 os_prio=0 tid=0x00007f6868e31000 nid=0x6648 waiting on condition [0x00007f6841ad4000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x00000000fb1da1c8> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
        at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:403)
        at com.aerospike.client.query.RecordSet.next(RecordSet.java:67)

Outher Aerospike threads:

"selector0" #10 daemon prio=5 os_prio=0 tid=0x00007f686870b800 nid=0x6628 runnable [0x00007f685653b000]
   java.lang.Thread.State: RUNNABLE
        at sun.nio.ch.EPollArrayWrapper.epollWait(Native Method)
        at sun.nio.ch.EPollArrayWrapper.poll(EPollArrayWrapper.java:269)
        at sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:93)
        at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86)
        - locked <0x00000000d6732e90> (a sun.nio.ch.Util$3)
        - locked <0x00000000d6732ea0> (a java.util.Collections$UnmodifiableSet)
        - locked <0x00000000d6732e48> (a sun.nio.ch.EPollSelectorImpl)
        at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:97)
        at com.aerospike.client.async.SelectorManager.runCommands(SelectorManager.java:87)
        at com.aerospike.client.async.SelectorManager.run(SelectorManager.java:69)
"tend" #11 daemon prio=5 os_prio=0 tid=0x00007f6868548000 nid=0x6629 waiting on condition [0x00007f6855e1a000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
        at java.lang.Thread.sleep(Native Method)
        at com.aerospike.client.util.Util.sleep(Util.java:38)
        at com.aerospike.client.cluster.Cluster.run(Cluster.java:256)
        at java.lang.Thread.run(Thread.java:748)

Client version: 3.1.2.

BrianNichols commented 3 years ago

That client version was released over 6 years ago and is no longer supported. You are using the old (now deleted) async framework that is prone to deadlock in some cases. I suggested upgrading to at least version 4.0.8 and switch to the new async methods in AerospikeClient.