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

block for replication with wtimeout throws OperationFailure exception

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.7.3
    • Affects Version/s: 1.6.0
    • Component/s: Replication
    • None
    • Environment:
      ubuntu 10.4, x86_64
    • Minor Change
    • ALL

      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.

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

              Created:
              Updated:
              Resolved: