[CDRIVER-556] Replica set changes cause a spurious error Created: 04/Mar/15 Updated: 03/May/17 Resolved: 11/Mar/15 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Charlie Page | Assignee: | A. Jesse Jiryu Davis |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Description |
|
Due to mongoD immediately dropping connections on a replica reconfig the C driver can report an error when there isn't one. |
| Comments |
| Comment by A. Jesse Jiryu Davis [ 11/Mar/15 ] |
|
No, in that case we add an idiosyncrasy to the C driver that is not shared with other drivers. If we addressed that problem by proposing a spec that requires all drivers to check the socket after issuing any command that could potentially cause the server to close sockets, such a spec would not be approved because it is much more complex than it's worth. An application that sends "replSetReconfig" must prepare for the consequences, the same as if it sent "stepdown" or "shutdown". |
| Comment by Charlie Page [ 11/Mar/15 ] |
|
Every operation would be expensive. What if we just check when the connection issues a reconfig command itself? |
| Comment by A. Jesse Jiryu Davis [ 11/Mar/15 ] |
|
Charlie I believe this is expected behavior for any driver; if the server drops connections in response to a reconfig the driver is likely to not detect that and experience a network error the next time it uses that socket. Many drivers, including now the C driver, check a socket for errors if it's been idle over a second, with poll or similar: https://github.com/hanumantmk/libmongoc/commit/2da0c4766c6f093bba2162b6c2de417632a989fb However, doing so on every operation would be too expensive, and still not prevent all possible network errors in the application after a reconfig. I propose the C driver behaves as designed. |