[JAVA-1566] Exception printed when calling FindFluent#first Created: 18/Nov/14  Updated: 01/Apr/16  Resolved: 08/Dec/14

Status: Closed
Project: Java Driver
Component/s: Async
Affects Version/s: 3.0.0
Fix Version/s: 3.0.0

Type: Bug Priority: Major - P3
Reporter: Nick Scavelli Assignee: Jeffrey Yemin
Resolution: Done Votes: 0
Labels: rc
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Getting the following stacktrace (operation still succeeds) when calling FindFluent#first

WARNING: Exception calling callback
java.lang.IllegalStateException: Attempted to decrement the reference count below 0
	at com.mongodb.binding.AbstractReferenceCounted.release(AbstractReferenceCounted.java:23)
	at com.mongodb.binding.AsyncClusterBinding$AsyncClusterBindingConnectionSource.release(AsyncClusterBinding.java:111)
	at com.mongodb.operation.OperationHelper$3$1.onResult(OperationHelper.java:219)
	at com.mongodb.async.SingleResultFuture.init(SingleResultFuture.java:102)
	at com.mongodb.operation.FindOperation$2$1.onResult(FindOperation.java:474)
	at com.mongodb.operation.FindOperation$2$1.onResult(FindOperation.java:468)
	at com.mongodb.async.SingleResultFuture.init(SingleResultFuture.java:102)
	at com.mongodb.connection.SingleResultFutureCallback.onResult(SingleResultFutureCallback.java:32)
	at com.mongodb.connection.QueryResultCallback.callCallback(QueryResultCallback.java:73)
	at com.mongodb.connection.ResponseCallback.onResult(ResponseCallback.java:49)
	at com.mongodb.connection.ResponseCallback.onResult(ResponseCallback.java:24)
	at com.mongodb.connection.UsageTrackingInternalConnection$3.onResult(UsageTrackingInternalConnection.java:131)
	at com.mongodb.connection.UsageTrackingInternalConnection$3.onResult(UsageTrackingInternalConnection.java:127)
	at com.mongodb.connection.InternalStreamConnection.processPendingResults(InternalStreamConnection.java:525)
	at com.mongodb.connection.InternalStreamConnection.processPendingReads(InternalStreamConnection.java:410)
	at com.mongodb.connection.InternalStreamConnection.access$1200(InternalStreamConnection.java:56)
	at com.mongodb.connection.InternalStreamConnection$3.onResult(InternalStreamConnection.java:445)
	at com.mongodb.connection.InternalStreamConnection$3.onResult(InternalStreamConnection.java:435)



 Comments   
Comment by Githook User [ 30/Jan/15 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: In AsyncQueryBatchCursor, setting connectionSource to null after release so that it's not double-released if killCursor is called more than once.

JAVA-1566
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/6882d4a877e6a445d6754680af3aae6d81aeae20

Comment by Ross Lawley [ 10/Dec/14 ]

This looks to have been resolved. I've also added a general smoke test for the async driver to help catch regressions.

Comment by Jeffrey Yemin [ 05/Dec/14 ]

Yeah, if you're on Java 7/8 and aren't using SSL, then you'll get AsynchronousSocketChannelStream, not NettyStream. Thanks.

Comment by Nick Scavelli [ 05/Dec/14 ]

Whatever the default one is, NIO one iirc.

Comment by Jeffrey Yemin [ 05/Dec/14 ]

nscavell which Stream implementation are you using?

Comment by Nick Scavelli [ 05/Dec/14 ]

Looks like this commit fixes things.

Comment by Githook User [ 05/Dec/14 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: In AsyncQueryBatchCursor, setting connectionSource to null after release so that it's not double-released if killCursor is called more than once.

JAVA-1566
Branch: 3.0.x
https://github.com/mongodb/mongo-java-driver/commit/6882d4a877e6a445d6754680af3aae6d81aeae20

Comment by Nick Scavelli [ 05/Dec/14 ]

Correction, FindFluent#first doesn't work at all. I'm getting this exception for FindFluent#into when using a limit of 1.

Comment by Nick Scavelli [ 04/Dec/14 ]

I was not getting this exception as of Sat commit 5a9393afaa836daf3175675939c1ad92a6bcde7f. Now FindFluent#first is not working, and I'm getting this exception again.

Comment by Matt Hurne [ 01/Dec/14 ]

I'm no longer seeing this exception occur in the latest snapshot build.

Comment by Ross Lawley [ 20/Nov/14 ]

Thanks nscavell will review post JAVA-1554

Comment by Nick Scavelli [ 19/Nov/14 ]

Looks like something with the iterable, as it's not just FindFluent#first.

Generated at Thu Feb 08 08:54:56 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.