[JAVA-1038] MongoException when connecting to a pool of mongos with a majority of them down Created: 05/Nov/13 Updated: 05/Nov/13 Resolved: 05/Nov/13 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Cluster Management |
| Affects Version/s: | 2.11.3 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Gui Forget | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
I'm initializing the Mongo instance (Java object) with the following options: ]}, dbDecoderFactory=DefaultDBDecoder.DefaultFactory, dbEncoderFactory=DefaultDBEncoder.DefaultFactory, safe=false, w=0, wtimeout=0, fsync=false, j=false, socketFactory=javax.net.DefaultSocketFactory@20c66135, cursorFinalizerEnabled=true, writeConcern=WriteConcern { "getlasterror" : 1}/ (Continue Inserting on Errors? false), alwaysUseMBeans=false}} HOST1, HOST2 and HOST3 are dead when I start due to a bad config. And I get the following error: If I start with the following options: ]}, dbDecoderFactory=DefaultDBDecoder.DefaultFactory, dbEncoderFactory=DefaultDBEncoder.DefaultFactory, safe=false, w=0, wtimeout=0, fsync=false, j=false, socketFactory=javax.net.DefaultSocketFactory@2cc29d3d, cursorFinalizerEnabled=true, writeConcern=WriteConcern { "getlasterror" : 1}/ (Continue Inserting on Errors? false), alwaysUseMBeans=false}} Then it starts fine. It's as if it ignored the localhost entry in the first case. I can reproduce this at will. |
| Comments |
| Comment by Jeffrey Yemin [ 05/Nov/13 ] | |
|
Closing as duplicate of | |
| Comment by Jeffrey Yemin [ 05/Nov/13 ] | |
|
Hi Gui, I can reproduce this at will too. This is a design flaw, and it will be fixed in the next release. As a workaround, try setting this system property to a much lower value than the default of 20,000 milliseconds, perhaps to 1000 milliseconds.
With this setting, It will take 1000 ms to try to connect to each of HOST1, HOST2, and HOST3, before settling on localhost. |