Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-1585

block for replication with wtimeout throws OperationFailure exception

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 1.6.0
    • Fix Version/s: 1.7.3
    • Component/s: Replication
    • Labels:
      None
    • Environment:
      ubuntu 10.4, x86_64
    • Backwards Compatibility:
      Minor Change
    • Operating System:
      ALL

      Description

      python code:

      err = db.command("getlasterror",
      w = 2, # replicate to at least one slave
      wtimeout = 1000 * timeout_s
      )

      Rather than return an error to be tested, if the above timesout, I get:

      File "build/bdist.linux-x86_64/egg/pymongo/database.py", line 294, in command
      pymongo.errors.OperationFailure: command SON([('getlasterror', 1), ('wtimeout', 2000), ('w', 2)]) failed: timed out waiting for slaves

      If a wtimeout is supplied, that indicates that a timeout is expected behavior--not exceptional behavior.
      It should simply return the result in the error object for examination, not throw OperationFailure.

        Attachments

          Activity

            People

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            nick@leippe.com Nick Leippe
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: