[JAVA-636] Massive amounts of Null Pointer Exceptions logged by Replica Set Updater Thread Created: 31/Aug/12  Updated: 07/Apr/23  Resolved: 05/Sep/12

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

Type: Bug Priority: Major - P3
Reporter: David Taylor Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: java
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates JAVA-581 Background threads continue to run af... Closed

 Description   

I have seen this error in both 2.7.3 and 2.9.0 when connecting to a replica set that seems to be up and running and in good status.

java.lang.NullPointerException
at com.mongodb.OutMessage.query(OutMessage.java:79)
at com.mongodb.OutMessage.query(OutMessage.java:75)
at com.mongodb.DBPort.findOne(DBPort.java:142)
at com.mongodb.DBPort.runCommand(DBPort.java:148)
at com.mongodb.ConnectionStatus$UpdatableNode.update(ConnectionStatus.java:184)
at com.mongodb.ReplicaSetStatus$UpdatableReplicaSetNode.update(ReplicaSetStatus.java:614)
at com.mongodb.ReplicaSetStatus$Updater.updateAll(ReplicaSetStatus.java:766)
at com.mongodb.ReplicaSetStatus$Updater.run(ReplicaSetStatus.java:736)

We have seen this error occur intermittently which will quickly fill up our logs and roll them continuously. It is often seen with the "server seen down" error, but then this error takes over the logs.



 Comments   
Comment by Jeffrey Yemin [ 05/Sep/12 ]

This duplicates JAVA-581, so I'm going to close it. Thanks for the report.

Comment by David Taylor [ 04/Sep/12 ]

I called close() in the shutdown hook of my spring container for all my Mongo objects, and that fixed the problem. I am no longer seeing the exceptions.

I'll leave the issue open though, as I think its something you'd want to fix if possible. The app is running on Glassfish 2.1, which could have some side-effects as to why your threads get in this state

Comment by Jeffrey Yemin [ 01/Sep/12 ]

Are you running in an application server and redeploying a web app right before this starts to happen? If so, make sure your app is calling the close method on all Mongo instances when the web app is undeployed.

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