Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-4541

Java driver returns wrong error code in retryable write

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: 3.12.10, 4.3.4
    • Component/s: Write Operations

      How to Reproduce

      1. Do a replaceOne for a document and have the server return a NotWritablePrimary error.
      2. When the driver retries, have it hang waiting for write concern
      3. Kill (-9) the server being retried on.
      4. Error returned is com.mongodb.MongoNotPrimaryException, indicating the replace didn't happen, though in fact it may have.

      If findOneAndReplace is used instead of replaceOne, a MongoSocketReadException is returned instead. 

       

        1. java4541_451_debug_log.txt
          23 kB
        2. java4541_debug_log.txt
          24 kB

            Assignee:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Reporter:
            matthew.russotto@mongodb.com Matthew Russotto
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: