[JAVA-1973] AbstractSubscription implementations need to track completed Created: 21/Sep/15  Updated: 07/Oct/15  Resolved: 21/Sep/15

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

Type: Improvement Priority: Major - P3
Reporter: Ross Lawley Assignee: Ross Lawley
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to JAVA-1931 com.mongodb.MongoSocketWriteException... Closed

 Description   

As multiple requests for data can occur before data is available, then implementations of AbstractSubscription must handle when the Subscriptions completed state.

Currently, completed defaults to true - so there is a race condition on multiple calls to request between the requesting initial data and then the processing of results that looks at the completed state. If results haven't come in it shortcuts to calling onComplete.



 Comments   
Comment by Jeffrey Yemin [ 07/Oct/15 ]

Released in 3.1.0

Comment by Githook User [ 21/Sep/15 ]

Author:

{u'username': u'rozza', u'name': u'Ross Lawley', u'email': u'ross.lawley@gmail.com'}

Message: Made checkCompleted abstract in AbstractSubscriptions

There is no guarantee that there would be single calls to request before data arrives.
Therefore checkCompleted should not default to true.

Tracking completed state fixes a potential race conditions for Subscriptions to SingleResultCallbacks.

JAVA-1973
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/2dacec65297753d8017cfc4f54dcaaa79ba35404

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