Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-901

_mongoc_write_result_complete() does not populate bson_error_t from write concern errors

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.2.0
    • Affects Version/s: 1.2-rc0
    • Component/s: libmongoc
    • None

      With CDRIVER-710, mongoc_write_result_t now stores an array of writeConcernErrors. As I was updating PHPC for this API change, I traced how write concern errors are reported, since we need to turn those bson_error_t output variables into exceptions.

      I traced the logic from mongoc_bulk_operation_execute() through to _mongoc_write_result_complete() and it appears that the bson_error_t is only ever set from write errors; however, the function may still return false for either !result->failed or bson_empty0 (&result->writeConcernErrors) (which is equivalent to checking for a non-zero result.n_writeConcernErrors value).

      I can't speak for the !result->failed case, but I believe we want to integrate mongos' write concern error merging logic here, which I would otherwise need to do in PHPC-434 and HHVM-112.

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: