In java aerospike client 6.0.0, thread blocked for infinite time in records.next() call, however we have set totalTimeout in queryPolicy to 30 seconds. This even happened we don’t have any data in the set for a particular secondary index value. We didn’t get failures in query but application hang in recordSet next function. I am attaching the backtrace and code snippet, Kindly suggest the solution.
Code as follows:
Map<Key, Record> map = new HashMap<Key, Record>();
RecordSet records = null;
try {
records = aerospike.getAerospikeClient().query(aerospike.getQueryPolicy(), stmt);;
while(records!=null && records.next())
{
Record record = records.getRecord();
Key key = records.getKey();
map.put(key, record);
}
}
Exception trace as follows:
io.vertx.core.VertxException: Thread blocked
at sun.misc.Unsafe.park(Native Method) ~[?:1.8.0_131]
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175) ~[?:1.8.0_131]
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039) ~[?:1.8.0_131]
at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:403) ~[?:1.8.0_131]
at com.aerospike.client.query.RecordSet.next(RecordSet.java:66) ~[JioUdmProv.jar:?]
at rjil.udmp.jioudmp.aerospike.AeroSpikeInterface.query(AeroSpikeInterface.java:546) ~[JioUdmProv.jar:?]
Cross posted at Aerospike java client RecordSet next function hang for infinite time after query a set - Stack Overflow.