Aerospike Java Async library seems stuck -


i executing udf using aeropike async client. client has been initialized as:-

    try {         asyncclientpolicy.maxthreads = 40;         asyncclientpolicy.asyncmaxcommands = 20;         asyncclientpolicy.maxsocketidle = 13;         asyncclientpolicy.asyncmaxcommandaction = maxcommandaction.block;         asyncclientpolicy.asyncselectorthreads = 7;         asyncclientpolicy.asynctaskthreadpool = executors.newfixedthreadpool(20, new threadfactory() {             public final thread newthread(runnable runnable) {                 thread thread = new thread(runnable);                 thread.setdaemon(true);                 return thread;             }         });     } 

so have 20 threads handle callbacks. after while see program not doing progress, indicating deadlock/starvation. jstack gives me following result:-

java.lang.thread.state: waiting (parking)     @ sun.misc.unsafe.park(native method)     - parking wait  <0x000000064048f338> (a java.util.concurrent.locks.abstractqueuedsynchronizer$conditionobject)     @ java.util.concurrent.locks.locksupport.park(locksupport.java:186)     @ java.util.concurrent.locks.abstractqueuedsynchronizer$conditionobject.await(abstractqueuedsynchronizer.java:2043)     @ java.util.concurrent.arrayblockingqueue.take(arrayblockingqueue.java:374)     @ com.aerospike.client.async.asynccluster$blockbufferqueue.getbytebuffer(asynccluster.java:114)     @ com.aerospike.client.async.asynccluster.getbytebuffer(asynccluster.java:68)     @ com.aerospike.client.async.asynccommand.execute(asynccommand.java:59)     @ com.aerospike.client.async.asyncclient.execute(asyncclient.java:949)     @ main.java.labs.ruleengineaerospikeconnection.updatepositivesegmentsudf(ruleengineaerospikeconnection.java:217)     @ main.java.labs.segment$productchecker.onsuccess(segment.java:346)     @ com.aerospike.client.async.asyncread.onsuccess(asyncread.java:149)     @ com.aerospike.client.async.asynccommand.finish(asynccommand.java:293)     @ com.aerospike.client.async.asyncsinglecommand.read(asyncsinglecommand.java:59)     @ com.aerospike.client.async.asynccommand.run(asynccommand.java:261)     @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1145)     @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:615)     @ java.lang.thread.run(thread.java:745) 

i have 20 threads in waiting state on execute command. doing wrong setup, because expect client return, if there exception in udf, happens if there infinite loop? lead behavior?

it's hard causing deadlock without looking @ source code. asyncclientpolicy looks sufficient.

in case, old asyncclient class has been obsolete since version 4. aerospikeclient class includes new async methods perform must faster old asyncclient. new async methods support netty event loops , run in non-blocking mode.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -