diff options
author | Gabriel Russell <gabriel.russell@mongodb.com> | 2019-06-06 15:11:16 -0400 |
---|---|---|
committer | Gabriel Russell <gabriel.russell@mongodb.com> | 2019-06-06 15:45:24 -0400 |
commit | b63264646b4d81e27cfd6e16d61a90ba31dd3d95 (patch) | |
tree | 17406d922503b7f45653f0d51da16b54c5f37831 /src | |
parent | fd2f851f6ce482064063286a6c763cf4dc2c4198 (diff) | |
download | mongo-b63264646b4d81e27cfd6e16d61a90ba31dd3d95.tar.gz |
SERVER-41120 perserve the correct status during scope timeout
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/scripting/mozjs/proxyscope.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/scripting/mozjs/proxyscope.cpp b/src/mongo/scripting/mozjs/proxyscope.cpp index b6ccdf26d08..fbe83f9ed83 100644 --- a/src/mongo/scripting/mozjs/proxyscope.cpp +++ b/src/mongo/scripting/mozjs/proxyscope.cpp @@ -302,10 +302,11 @@ void MozJSProxyScope::runOnImplThread(unique_function<void()> f) { try { interruptible->waitForConditionOrInterrupt(_proxyCondvar, lk, pred); } catch (const DBException& ex) { - _status = ex.toStatus(); - _implScope->kill(); _proxyCondvar.wait(lk, pred); + + // update _status after the wait, otherwise it would get overwritten in implThread + _status = ex.toStatus(); } _state = State::Idle; |