Failpoint errors may not be considered a failure

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 1.17.0-beta, 1.17.0
    • Affects Version/s: None
    • Component/s: libmongoc
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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).

            Assignee:
            Kevin Albertson
            Reporter:
            Patrick Freed
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: