Closed
Description
I use the code below: the branch is 5.0.1
ArangoDB.Builder build = new ArangoDB.Builder();
String[] hostWithPorts = host.split(",");
for (String hostWithPort : hostWithPorts) {
String[] array = hostWithPort.split(":");
build = build.host(array[0], Integer.valueOf(array[1]));
}
build.user(user).password(pass)..loadBalancingStrategy(LoadBalancingStrategy.ROUND_ROBIN).maxConnections(connections).timeout(timeout).acquireHostList(true).connectionTtl(ttl).build();
the timout i set 120s, where I run it for some slow query, I found there are 1000 more threads is running, even the query task has finished, those threads also exist, but always exist, the jstack info is :
"pool-8538-thread-1" #68934 prio=5 os_prio=0 tid=0x00007fd83cf09800 nid=0xd983 runnable [0x00007fd7b2240000]
java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:171)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at com.arangodb.internal.velocystream.internal.VstConnection.readBytesIntoBuffer(VstConnection.java:260)
at com.arangodb.internal.velocystream.internal.VstConnection.readBytes(VstConnection.java:254)
at com.arangodb.internal.velocystream.internal.VstConnection.readChunk(VstConnection.java:231)
at com.arangodb.internal.velocystream.internal.VstConnection$1.call(VstConnection.java:141)
at com.arangodb.internal.velocystream.internal.VstConnection$1.call(VstConnection.java:124)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Locked ownable synchronizers:
- <0x00000000fef8dc60> (a java.util.concurrent.ThreadPoolExecutor$Worker)
"pool-8537-thread-1" #68933 prio=5 os_prio=0 tid=0x00007fd83cf07800 nid=0xd982 runnable [0x00007fd7b2341000]
java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:171)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at com.arangodb.internal.velocystream.internal.VstConnection.readBytesIntoBuffer(VstConnection.java:260)
at com.arangodb.internal.velocystream.internal.VstConnection.readBytes(VstConnection.java:254)
at com.arangodb.internal.velocystream.internal.VstConnection.readChunk(VstConnection.java:231)
at com.arangodb.internal.velocystream.internal.VstConnection$1.call(VstConnection.java:141)
at com.arangodb.internal.velocystream.internal.VstConnection$1.call(VstConnection.java:124)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Locked ownable synchronizers:
- <0x00000000fef8e1d0> (a java.util.concurrent.ThreadPoolExecutor$Worker)
I check the source code, the com.arangodb.internal.velocystream.internal.VstConnection::open() , Where I the code before the socket.connect
socket.setSoTimeout(timeout != null ? timeout : ArangoDefaults.DEFAULT_TIMEOUT);
where the query tasks have finished, those thread will disappear later.
Metadata
Metadata
Assignees
Labels
No labels