[SERVER-13485] ScopedThread is not defined in rc3 mongo shell Created: 04/Apr/14  Updated: 15/Oct/14  Resolved: 04/Apr/14

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: 2.6.0-rc3
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Rui Zhang (Inactive) Assignee: Scott Hernandez (Inactive)
Resolution: Done Votes: 0
Labels: 26qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

ScopedThread is undefined in 2.6.0 rc3 shell, it work fine with rc2 shell.

## RC2 shell
root@rui-linux:/sys/kernel/mm/transparent_hugepage# /ssd2/mongodb-linux-x86_64-2.6.0-rc2/bin/mongo
MongoDB shell version: 2.6.0-rc2
connecting to: test
> t = new ScopedThread("test")
2014-04-03T17:12:51.009-0700 Error: first argument must be a function at src/mongo/shell/utils.js:113
> f = function() {return "";}
function () {return "";}
> t = new ScopedThread(f)
{
        "init" : function init() { [native code] },
        "start" : function start() { [native code] },
        "join" : function join() { [native code] },
        "returnData" : function returnData() { [native code] }
}
>
 
## RC3 shell
root@rui-linux:/sys/kernel/mm/transparent_hugepage# /ssd2/mongodb-linux-x86_64-2.6.0-rc3/bin/mongo
MongoDB shell version: 2.6.0-rc3
connecting to: test
> f = function() {return "";}
function () {return "";}
> t = new ScopedThread(f)
2014-04-03T17:14:07.873-0700 ReferenceError: ScopedThread is not defined
>



 Comments   
Comment by James Tan [ 15/Oct/14 ]

FWIW a workaround is to download or checkout parallelTester.js and load it in Mongo shell. For example:

$ curl -O https://raw.githubusercontent.com/mongodb/mongo/master/jstests/libs/parallelTester.js
$ mongo
MongoDB shell version: 2.6.4
connecting to: test
> new ScopedThread(function() {})
2014-10-15T16:33:20.878+0100 ReferenceError: ScopedThread is not defined
> load("parallelTester.js")
true
> new ScopedThread(function() {})
{
  "init": function init() { [native code] },
  "join": function join() { [native code] },
  "returnData": function returnData() { [native code] },
  "start": function start() { [native code] }
}
>

Comment by Antonio Quintana [ 16/May/14 ]

I think it should be added again. Ok, you closed this issue with the tag "Works as Designed", but many "old" designs include this feature and you just removed it with apparently no reason.

I have defended MongoDB saying that they can use multithread programming and I have amused them with many examples.

Why did you remove it?

Comment by John Page [ 25/Apr/14 ]

Unfortunate as Paul Done just did a blog post on using them to speed up aggregation. And Antione Girbal has a similar one for Map-Reduce

Comment by Scott Hernandez (Inactive) [ 04/Apr/14 ]

These helpers were moved to a common place that is used for tests, and out of the shell proper.

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