[CDRIVER-557] failed client creation doesn't result in Null returned Created: 04/Mar/15 Updated: 03/May/17 Resolved: 04/Mar/15 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | None |
| Affects Version/s: | 1.0.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Mark Stevens | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | Bug, Client, Connection | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows 7, visual studio 2010 express, |
||
| Description |
|
Utilising the mongoc driver, ive discovered that when you create a connection, using The returned value when the mongodb isnt running is not a null value. This means any tests/checks carried out do not catch that the server hasnt been connected to, causing issues further down the line. Looking in the source I can't see anything that would set a value Null, either in v1.0.2, not v1.1.0 that was recently released. |
| Comments |
| Comment by Hannes Magnusson [ 04/Mar/15 ] |
|
This is intentional. This is done for HA reasons; You should always be able to create a mongoc_client_t instance – even when the server is down. You should be checking the results of all over-the-wire operations anyway, as they could fail at any time, so lazy connections actually reduce the amount of error checking you need to do in your code since you don't need to handle failing to create mongoc_client |