[SERVER-13393] Off-by-one in wtimeout error message in shell's WriteConcern constructor Created: 27/Mar/14  Updated: 19/Sep/15  Resolved: 24/Aug/15

Status: Closed
Project: Core Server
Component/s: Shell, Write Ops
Affects Version/s: 2.6.0-rc2
Fix Version/s: 3.1.8

Type: Bug Priority: Minor - P4
Reporter: Kamran K. Assignee: Andrew Morrow (Inactive)
Resolution: Done Votes: 0
Labels: 26qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

new WriteConcern(0, 0)

Sprint: Platform 8 08/28/15
Participants:

 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



 Comments   
Comment by Githook User [ 24/Aug/15 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}

Message: SERVER-13393 Improve error message on negative bulk timeouts
Branch: master
https://github.com/mongodb/mongo/commit/fbefbf20ffee569876e912b97648ada39010f65c

Generated at Thu Feb 08 03:31:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.