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

Failpoint errors may not be considered a failure

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 1.17.0-beta, 1.17.0
    • None
    • libmongoc
    • None

    Description

      Given the following code sample:

      if (!mongoc_collection_insert_one(collection, insert, NULL, &reply, &error)) {
                  printf("err inserting reply: %s err: %s\n", bson_as_relaxed_extended_json(&reply, NULL), error.message);
              } else {
                  printf("success: %s\n", bson_as_relaxed_extended_json(&reply, NULL));
              }
      

      it prints

      success: { "insertedCount" : 1, "writeConcernErrors" : [ { "code" : 91.0, "errmsg" : "Replication is being shut down" } ] }
      

      when encountering a write concern error. This means the function returned true, even though the docs state that a write concern error should be considered a failure. I believe this applies to the other crud functions as well (including bulk writes).

      Attachments

        Activity

          People

            kevin.albertson@mongodb.com Kevin Albertson
            patrick.freed@mongodb.com Patrick Freed
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: