[CDRIVER-3303] Some options not applied for OP_MSG without sessions Created: 10/Aug/19 Updated: 28/Oct/23 Resolved: 07/May/20 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | libmongoc |
| Affects Version/s: | None |
| Fix Version/s: | 1.17.0-beta2, 1.17.0 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Kevin Albertson | Assignee: | Roberto Sanchez |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
mongoc_cmd_parts_assemble assembles options and the base command document into a final command to send. parts->body is the base command, like
parts->assembled_body is the base command with options set, like:
parts->assembled.command is the final assembled command to send. This either points to parts->body if no options are required to be appended to the base command, or is set to parts->assembled_body otherwise. (I think perhaps this is a micro optimization, to avoid copying the command if we don't need to.) So, at the start of the mongoc_cmd_parts_assemble there is:
And whenever an option is set, you're supposed to call
My guess is that this is a micro-optimization, to avoid copying parts->body if no options were set and nothing changed. However, we don't always call _mongoc_cmd_parts_ensure_copied every time options are set, meaning we might omit sending them. I don't think it's currently possible for this to surface because this only applies when:
Because of |
| Comments |
| Comment by Githook User [ 25/May/20 ] |
|
Author: {'name': 'Roberto C. Sánchez', 'email': 'roberto@connexer.com', 'username': 'rcsanchez97'}Message: |
| Comment by Githook User [ 07/May/20 ] |
|
Author: {'name': 'Roberto C. Sánchez', 'email': 'roberto@connexer.com', 'username': 'rcsanchez97'}Message: |
| Comment by Kevin Albertson [ 10/Aug/19 ] |
|
Here is a branch with a repro (with a workaround for |