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

Off-by-one in wtimeout error message in shell's WriteConcern constructor

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: 2.6.0-rc2
    • Fix Version/s: 3.1.8
    • Component/s: Shell, Write Ops
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      new WriteConcern(0, 0)

      Show
      new WriteConcern(0, 0)
    • Sprint:
      Platform 8 08/28/15

      Description

      The shell's WriteConcern constructor has an error message that indicates that wtimeout values must be greater than 0. The code allows wtimeout:0 values, though:

      src/mongo/shell/bulk_api.js:

      71  if (NumberInt( opts.wtimeout ).toNumber() < 0)
      72   throw Error("wtimeout must be a number greater than 0, not " + opts.wtimeout);
      

      Output:

      > new WriteConcern(0, -1)
      2014-03-27T18:16:33.546-0400 Error: wtimeout must be a number greater than 0, not -1 at src/mongo/shell/bulk_api.js:72
      > new WriteConcern(0, 0)
      WriteConcern({ "w" : 0, "wtimeout" : 0 })
      


      Version: 98e464bc2a21ad4b706854ad640957060fa0fa6f

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: