[CXX-1391] reset client options when returned to the pool Created: 12/Jul/17 Updated: 12/Jul/17 Resolved: 12/Jul/17 |
|
| Status: | Closed |
| Project: | C++ Driver |
| Component/s: | Implementation |
| Affects Version/s: | 3.1.1 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Pierre Petitprez | Assignee: | David Golden |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Description |
|
When I acquire a client from a pool and manually modify the write concern at client level (client::write_concern(wc)), the modified client is released to the pool. Later on, if I acquire a new client from this pool, I may end-up with a client with the modified write concern, which does not correspond to the one the pool has been created with. With current behavior, application code seems to be responsible to reset the client write concern to an appropriate value before it is released to the pool. The pool should take care of resetting the write concern to an appropriate value or the write_concern of a client acquired from the pool should be read-only. |
| Comments |
| Comment by David Golden [ 12/Jul/17 ] |
|
Hi. Thanks for the bug report and are sorry that you experienced this problem. Unfortunately, this is a limitation of libmongoc. In the next release of the C++ driver (3.2.0), modifying client options will be deprecated (see We recommend setting default client options in the URI string used to configure the pool or setting operation-specific options such as write concern on the database/collection objects acquired from a checked out client. This will avoid the problem you experienced. |