[JAVA-227] NPE when replica set is down Created: 06/Dec/10 Updated: 17/Mar/11 Resolved: 17/Feb/11 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Cluster Management |
| Affects Version/s: | 2.3 |
| Fix Version/s: | 2.5 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jeff Yemin (Inactive) | Assignee: | Antoine Girbal |
| Resolution: | Done | Votes: | 2 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
1.62 linux 64 bit server |
||
| Attachments: |
|
| Description |
|
When the whole replica set is down, java driver generates this log message every 5 seconds. 2010-12-06 14:35:10,294 ERROR [STDERR] (ReplicaSetStatus:Updater) Dec 6, 2010 2:35:10 PM com.mongodb.ReplicaSetStatus$Node update Seems like an NPE is not what should happen. Strange thing is that OutMessage.java:73 is
and I'm not sure how that line could generate an NPE. |
| Comments |
| Comment by Antoine Girbal [ 17/Feb/11 ] |
|
will reopen if issues is brought up again. |
| Comment by Jeff Yemin (Inactive) [ 17/Feb/11 ] |
|
I haven't see it again, but I haven't brought down the replica set entirely. This is definitely not high priority for us though. |
| Comment by Antoine Girbal [ 17/Feb/11 ] |
|
let me know if you are still experiencing the problem with newest driver. |
| Comment by Antoine Girbal [ 13/Dec/10 ] |
|
I attached a jar file that has a new init block for the ID field. private final static AtomicInteger ID; static { ID = new AtomicInteger(1); }let me know if it makes any difference. |
| Comment by Jeff Yemin (Inactive) [ 10/Dec/10 ] |
|
I tried with a simple test program and couldn't reproduce it, which is not surprising. |
| Comment by Swen Thümmler [ 10/Dec/10 ] |
|
I'm seeing the very same symptom with glassfish 2.1.1 |
| Comment by Antoine Girbal [ 07/Dec/10 ] |
|
ok well maybe jboss reorders the loading of class, and does not initialize the ID first. If you have ability to compile, could you try:
if that doesnt work, we can always add a catch for NPE errors and then initialize ID, but it's sad. |
| Comment by Jeff Yemin (Inactive) [ 06/Dec/10 ] |
|
So far only seen it after restarting our app with replica set already down (all nodes in replica set are unreachable). |
| Comment by Antoine Girbal [ 06/Dec/10 ] |
|
That's very odd behavior, this ID is a static variable that should be initialized whenever class is loaded, before using any method from it. |
| Comment by Jeff Yemin (Inactive) [ 06/Dec/10 ] |
|
Also, don't see the NPE when the replica set is up. |
| Comment by Jeff Yemin (Inactive) [ 06/Dec/10 ] |
|
Also note that we are running this in JBoss 4.2.3, which has rather funky class-loading. |
| Comment by Jeff Yemin (Inactive) [ 06/Dec/10 ] |
|
Confirmed in debugger that OutMessage.ID is null. |