summaryrefslogtreecommitdiff
path: root/src/mongo/scripting
diff options
context:
space:
mode:
authorJason Carey <jcarey@argv.me>2016-02-05 10:02:08 -0500
committerJason Carey <jcarey@argv.me>2016-02-05 13:57:30 -0500
commitdfc320fe9c8a5227b08c77a87f52996cf40b0206 (patch)
tree8330783025dae81d1e0ad93c610bd4c77ee6eb0c /src/mongo/scripting
parent0bc96b1ede73c82d45b6d6c2e0b9a33e613ca7c3 (diff)
downloadmongo-dfc320fe9c8a5227b08c77a87f52996cf40b0206.tar.gz
SERVER-22349 Throw exceptions from loadStored
The JS engine's loadStored eats exceptions that occur while it's loading functions from system.js. This also eats interruption exceptions, which can lead to a situation where a map reduce job is killed during loadStored, but the interrupt is lost. For tests where the map or reduce stages are long or non-terminating, and we rely on killing them, this can lead to hangs. Removing the try/catch block around loadStored fixes this behavior.
Diffstat (limited to 'src/mongo/scripting')
-rw-r--r--src/mongo/scripting/engine.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/mongo/scripting/engine.cpp b/src/mongo/scripting/engine.cpp
index 632957a5d08..8891c19acfa 100644
--- a/src/mongo/scripting/engine.cpp
+++ b/src/mongo/scripting/engine.cpp
@@ -226,14 +226,9 @@ void Scope::loadStored(OperationContext* txn, bool ignoreNotConnected) {
uassert(10209, str::stream() << "name has to be a string: " << n, n.type() == String);
uassert(10210, "value has to be set", v.type() != EOO);
- try {
- setElement(n.valuestr(), v, o);
- thisTime.insert(n.valuestr());
- _storedNames.insert(n.valuestr());
- } catch (const DBException& setElemEx) {
- error() << "unable to load stored JavaScript function " << n.valuestr()
- << "(): " << setElemEx.what() << endl;
- }
+ setElement(n.valuestr(), v, o);
+ thisTime.insert(n.valuestr());
+ _storedNames.insert(n.valuestr());
}
// remove things from scope that were removed from the system.js collection