N1QL dead lock java sdk 2.1.1 when 2 consecutive query call


#1

Hi ,
in this simple code the second query call fail into dead lock why ?
@Test
public void test() {
CouchbaseEnvironment env = DefaultCouchbaseEnvironment.builder()
.queryEnabled(true)
.build();

	CouchbaseCluster n1qlCluster = CouchbaseCluster.create(env, "http://localhost:8093");
	Bucket bucket = n1qlCluster.openBucket("catalog");

	Query query = Query.simple("select * from catalog where type='offer'");

	System.out.println("Querying 1 N1QL : " + query.n1ql().toString());

	QueryResult queryResult = bucket.query(query);
	System.out.println("Query metrics 1 N1QL : " + queryResult.info());

	System.out.println("Querying 2 N1QL : " + query.n1ql().toString());
	queryResult = bucket.query(query);
	System.out.println("Query metrics 2 N1QL : " + queryResult.info());

}

and the log trace
2015-04-08 12:09:22.583 INFO — [ main] com.couchbase.client.core.CouchbaseCore : CoreEnvironment: {sslEnabled=false, sslKeystoreFile=‘null’, sslKeystorePassword=‘null’, queryEnabled=true, queryPort=8093, bootstrapHttpEnabled=true, bootstrapCarrierEnabled=true, bootstrapHttpDirectPort=8091, bootstrapHttpSslPort=18091, bootstrapCarrierDirectPort=11210, bootstrapCarrierSslPort=11207, ioPoolSize=32, computationPoolSize=32, responseBufferSize=16384, requestBufferSize=16384, kvServiceEndpoints=1, viewServiceEndpoints=1, queryServiceEndpoints=1, ioPool=NioEventLoopGroup, coreScheduler=CoreScheduler, eventBus=DefaultEventBus, packageNameAndVersion=couchbase-java-client/2.1.1 (git: 2.1.1), dcpEnabled=false, retryStrategy=BestEffort, maxRequestLifetime=75000, retryDelay=com.couchbase.client.core.time.ExponentialDelay@2bea5ab4, reconnectDelay=com.couchbase.client.core.time.ExponentialDelay@3d8314f0, observeIntervalDelay=com.couchbase.client.core.time.ExponentialDelay@2df32bf7, keepAliveInterval=30000, autoreleaseAfter=2000}
2015-04-08 12:09:23.021 INFO — [ cb-io-1-1] com.couchbase.client.core.node.Node : Connected to Node localhost
2015-04-08 12:09:23.571 INFO — [-computations-5] c.c.c.core.config.ConfigurationProvider : Opened bucket catalog
Querying 1 N1QL : {“statement”:“select * from catalog where type=‘offer’”}
Query metrics 1 N1QL : {“executionTime”:“73.0042ms”,“resultCount”:90,“resultSize”:146650,“elapsedTime”:“73.0042ms”}
Querying 2 N1QL : {“statement”:“select * from catalog where type=‘offer’”}


#2

Can you please try with 2.1.2 (which has been already released) and see if it fixes your issues?


#3

it run better BUT … logging QueryMetrics failed
here is my new console log
Querying 1 N1QL : {“statement”:“select * from catalog where type=‘offer’”}
Query metrics 1 N1QL : com.couchbase.client.java.query.QueryMetrics@2bb3058
Querying 2 N1QL : {“statement”:“select id from catalog where type=‘offer’”}
Query metrics 2 N1QL : com.couchbase.client.java.query.QueryMetrics@60df60da
(System.out.println("Query metrics 2 N1QL : " + queryResult.info()); )


#4

yes, the query metrics turned into an actual object. We still need to add a toString so that it logs nicely, but it is expected at the moment. You can work around that by dumping the actual fields or falling back to the raw content for dumping (like queryResult.info().asJsonObject())


#5

oki thanks (it is not critical for us)