[JAVA-626] race condition in DB.requestEnsureConnection can cause NullPointerException Created: 21/Aug/12 Updated: 29/Aug/12 Resolved: 22/Aug/12 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Cluster Management |
| Affects Version/s: | None |
| Fix Version/s: | 2.9.0 |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Barrie Segal | Assignee: | Jeffrey Yemin |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Description |
|
With a replica set connection, use of DB.requestEnsureConnection has a race condition which can cause a NullPointerException:
This race condition is not actually new, but the NPE happens more frequently now that the driver is handling a list of servers that can be either mongos server or replica set members. |
| Comments |
| Comment by Jeffrey Yemin [ 29/Aug/12 ] | ||||||||||||||||||
|
Closing as part of 2.9.0 release process. | ||||||||||||||||||
| Comment by Jeffrey Yemin [ 22/Aug/12 ] | ||||||||||||||||||
|
You do not need to upgrade the Java driver to 2.9.0 to use Mongo server 2.2.0. 2.8.0 is compatible. | ||||||||||||||||||
| Comment by Steve Benjamin [ 22/Aug/12 ] | ||||||||||||||||||
|
Tried this version out this morning (2.9 rc2) and confirm that it fixed the error I was seeing. Thanks. On a side note, can someone reply to the question that triggered this, which was if this version of the driver is necessary for Mongo 2.2? | ||||||||||||||||||
| Comment by auto [ 22/Aug/12 ] | ||||||||||||||||||
|
Author: {u'date': u'2012-08-21T20:52:06-07:00', u'email': u'jeff.yemin@10gen.com', u'name': u'Jeff Yemin'}Message: | ||||||||||||||||||
| Comment by Steve Benjamin [ 21/Aug/12 ] | ||||||||||||||||||
|
From the question "Can you please show the code for how you're creating the Mongo instance?" on CS-4182:
|