[JAVA-1634] ServerAddressSelector returns a List with a null element Created: 27/Jan/15  Updated: 29/Jan/15  Resolved: 28/Jan/15

Status: Closed
Project: Java Driver
Component/s: Cluster Management
Affects Version/s: None
Fix Version/s: 2.13.0

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


 Description   

On Jenkins, we occasionally see this stack trace:

java.lang.NullPointerException
	at com.mongodb.BaseCluster.getRandomServer(BaseCluster.java:204)
	at com.mongodb.BaseCluster.getServer(BaseCluster.java:75)
	at com.mongodb.DBTCPConnector.getServer(DBTCPConnector.java:650)
	at com.mongodb.DBTCPConnector.access$300(DBTCPConnector.java:39)
	at com.mongodb.DBTCPConnector$MyPort.error(DBTCPConnector.java:482)
	at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:301)
	at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:268)
	at com.mongodb.DBTCPConnectorTest.testConnectionReservationForReadThenWrite(DBTCPConnectorTest.java:137)

I've traced it down to ServerAddressSelector.choose returning a list with a single null element in the case where the ServerAddress is no longer in the cluster.



 Comments   
Comment by Jeffrey Yemin [ 29/Jan/15 ]

2.13.0 has been released. Closing issue.

Comment by Githook User [ 27/Jan/15 ]

Author:

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

Message: Ensured that ServerAddressSelector.choose returns either a List with a single ok ServerDescription, or else an empty list.
Ensured that an attempt to invalidate a server after an error doesn't fail if that server has already been removed from the cluster description.

JAVA-1634
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/648cdce30078d66855c95d481370c68558028dd3

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