W/CouchbaseLite/QUERY: [JAVA] End of query enumeration

We are trying to update from 2.8 to 3.x for our Android app.

We were seeing this issue in 3.0.0
W/ Couchbase Lite/QUERY: [JAVA] End of query enumeration
E/System: Uncaught exception thrown by finalizer
E/System: java.lang.NullPointerException: Null reference used for synchronization (monitor-enter)

Which looks like:
https://issues.couchbase.com/browse/CBL-1659
Is this fixed in 3.0.2 or do we need to wait until 3.1.x?

After updating to 3.0.2, I see a lot of couchbase traces with the following warning:
W/CouchbaseLite/QUERY: [JAVA] End of query enumeration

What is this warning, and how do I prevent it? Is there an actual problem?

There isn’t enough of the exception stack trace there so that I have a prayer of figuring out what happened.

Still, I suspect you are right: this is probably CBL-3299 and I confirm that it is fixed in 3.0.2, available shortly.

Ahh nice, yes CBL-3299 does look like it may be the issue we were seeing in 3.0.0 the full stack trace does include info about the finalizer.

W/CouchbaseLite/QUERY: [JAVA] End of query enumeration
E/System: Uncaught exception thrown by finalizer
E/System: java.lang.NullPointerException: Null reference used for synchronization (monitor-enter)
        at com.couchbase.lite.internal.core.C4NativePeer.releasePeer(C4NativePeer.java:118)
        at com.couchbase.lite.internal.core.C4Document.closePeer(C4Document.java:186)
        at com.couchbase.lite.internal.core.C4Document.finalize(C4Document.java:142)
        at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:289)
        at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:276)
        at java.lang.Daemons$Daemon.run(Daemons.java:137)
        at java.lang.Thread.run(Thread.java:919)

What about the second question - in 3.0.2 we see single traces (without any exceptions) of:

W/CouchbaseLite/QUERY: [JAVA] End of query enumeration

Is that warning expected? Is it harmful? It seems to be tracing that warning every time we execute a query, yet the queries are successful.

Edit: Ahh I see the code generating this warning, it appears to happen public Result next() when reaching the end of the results when doing a forEach on the ResultSet. Should that really be a warning - that seems like a pretty common operation?

Ok, so: better for the rest of the world if you put things like this in a new ticket: that makes it searchable by others with the same problem. But just this one time… :stuck_out_tongue_winking_eye:

The first message is probably not of concern. It is annoying, though, and may actually slow the finalizer down: it is fixed in recent releases in the 3.x line.

The second message means that you have called next() past the end of a ResultSet. That, also shouldn’t be a problem. I’m not sure of why we think it is worth logging. That’s something I just inherited.