Waiting for QueryFuture to finish - LiveQuery

#1

Hello,

I am using LiveQuery for a project and this type of error happens when changes are made in my Couchbase Server.

Query: Got exception waiting for queryFuture to finish
 java.lang.InterruptedException
at java.util.concurrent.FutureTask.awaitDone(FutureTask.java:400)
at java.util.concurrent.FutureTask.get(FutureTask.java:187)
at com.couchbase.lite.LiveQuery$2.run(LiveQuery.java:322)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)

My LiveQuery itself is very simple, this is a small part of code where I instanciate it (changeView is a simple com.couchbase.lite.View) :

Query changeViewQuery = changeView.createQuery(); changeViewQuery.setMapOnly(true); changeViewQuery.setDescending(true); changeViewLiveQuery = changeViewQuery.toLiveQuery(); /* Initialization of the liveQuery listener */ changeViewLiveQuery.start();

Do you have any idea about the origin of this issue ? I can provide other pieces of code if needed.

Many thanks,
Damien

#2

Thanks for reporting. I think that error is probably harmless, but it’s worth getting to the root of it and cleaning it up.

Can you file an issue on github for it?

Also:

  • please provide code samples where you stop that live query (assuming you do) or the code that you call which triggers the exception.

  • mention which couchbase lite release version or master branch commit you are using.

#3

I just created the issue, can be closed here.

Many thanks,
Damien

#4

Ok thanks. I will get back to you on https://github.com/couchbase/couchbase-lite-java-core/issues/278