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

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

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.1.8
    • Affects Version/s: 2.6.0-rc2
    • Component/s: Shell, Write Ops
    • Fully Compatible
    • ALL
    • Hide
      new WriteConcern(0, 0)
      
      Show
      new WriteConcern(0, 0)
    • Platform 8 08/28/15

      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

            Assignee:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Reporter:
            kamran.khan Kamran K.
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: