Uploaded image for project: 'CouchDB'
  1. CouchDB
  2. COUCHDB-1901

Replicator needs to retry multipart requests atomically

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.5.0
    • Component/s: Replication
    • Labels:
      None

      Description

      couch_replicator_httpc's retry mechanism interacts poorly with the multipart requests we use to transfer attachments during replication. In the case of PUTs, the replicator will retry a request even though it has already streamed part of the request body. For GETs, it can potentially interleave body data from the original response and the retried one.

      I put together a fix at https://github.com/cloudant/couch_replicator/pull/36 that disables the default httpc client retry mechanism for multipart requests and manages the retry logic "atomically"; i.e., it retries the original GET request if the GET or PUT fails, and it ensures that the original GET request is properly terminated during the retry. I'll push a version of that patch to the Apache repo now.

        Attachments

          Activity

            People

            • Assignee:
              kocolosk Adam Kocoloski
              Reporter:
              kocolosk Adam Kocoloski
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: