[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:
Depends
is depended on by PHPC-1076 Expose result document for failed com... Closed

 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: CDRIVER-2611 add reply to command_failed apm
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/0a85d21c282d07d9d3a8cab9389d213606bbc0f3

Comment by Katherine Walker (Inactive) [ 20/Apr/18 ]

PR: https://github.com/mongodb/mongo-c-driver/pull/492

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?:

https://github.com/mongodb/specifications/blob/master/source/command-monitoring/command-monitoring.rst#api

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.

Generated at Wed Feb 07 21:15:47 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.