[CDRIVER-2611] Add server reply to mongoc_apm_command_failed_t Created: 12/Apr/18 Updated: 28/Oct/23 Resolved: 25/Apr/18 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 1.10.0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Katherine Walker (Inactive) | Assignee: | Katherine Walker (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
The PHP driver would like to expose the server reply for failed commands via CommandFailedEvent. In order to do this, we need mongoc_apm_command_failed_t to contain the server reply like mongoc_apm_command_succeeded_t does. |
| Comments |
| Comment by Githook User [ 25/Apr/18 ] |
|
Author: {'email': 'kvwalker@users.noreply.github.com', 'username': 'kvwalker', 'name': 'Katherine Walker'}Message: |
| Comment by Katherine Walker (Inactive) [ 20/Apr/18 ] |
| Comment by Katherine Walker (Inactive) [ 17/Apr/18 ] |
|
Here's the PR for the SPEC ticket: https://github.com/mongodb/specifications/pull/305. |
| Comment by Jeremy Mikola [ 13/Apr/18 ] |
|
jesse: IIRC, the command_with_opts methods always ensure that the reply is at least an empty bson_t (it allocates it up front and requires the caller to free it). Are you thinking of detecting that with bson_empty() and instead leave it NULL for APM, in order to make it more consistent with write and query command failures where there is no pre-allocated reply document? |
| Comment by A. Jesse Jiryu Davis [ 12/Apr/18 ] |
|
This would be useful, yes. Can you start with a SPEC ticket and a pull request that adds the field to CommandFailedEvent and explains when it is non-empty?: I propose that it's empty / null / whatever your language wants when there was no server reply at all, e.g. a network error. It's non-empty if the server replied with ok: 0. |