summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJason Carey <jcarey@argv.me>2019-02-10 20:45:32 -0500
committerJason Carey <jcarey@argv.me>2019-02-10 20:45:32 -0500
commite92533300de16584d7fd59415a8cfc9d90eaef5b (patch)
treedb33b30115bb9447bffc7b4c4cc2f35fc8090f60 /src
parent21b5477520744ca02e1574160caa31e0633849dd (diff)
downloadmongo-e92533300de16584d7fd59415a8cfc9d90eaef5b.tar.gz
SERVER-39183 Avoid opCtx wait in implscope sleep
It's not necessary about races with killop
Diffstat (limited to 'src')
-rw-r--r--src/mongo/scripting/mozjs/implscope.cpp17
1 files changed, 1 insertions, 16 deletions
diff --git a/src/mongo/scripting/mozjs/implscope.cpp b/src/mongo/scripting/mozjs/implscope.cpp
index 21b29841d52..a3c18a32708 100644
--- a/src/mongo/scripting/mozjs/implscope.cpp
+++ b/src/mongo/scripting/mozjs/implscope.cpp
@@ -199,14 +199,10 @@ bool MozJSImplScope::_interruptCallback(JSContext* cx) {
auto status = [&scope]() -> Status {
stdx::lock_guard<stdx::mutex> lk(scope->_mutex);
- if (scope->_inOp > 0 && scope->_opCtx) {
- scope->_killStatus = scope->_opCtx->checkForInterruptNoAssert();
- }
-
return scope->_killStatus;
}();
- if (status.isOK() && scope->_hasOutOfMemoryException) {
+ if (scope->_hasOutOfMemoryException) {
status = Status(ErrorCodes::JSInterpreterFailure, "Out of memory");
}
@@ -786,17 +782,6 @@ void MozJSImplScope::gc() {
void MozJSImplScope::sleep(Milliseconds ms) {
stdx::unique_lock<stdx::mutex> lk(_mutex);
- if (_opCtx) {
- try {
- _opCtx->waitForConditionOrInterruptFor(_sleepCondition, lk, ms);
- } catch (const DBException& ex) {
- _killStatus = ex.toStatus();
- uasserted(ErrorCodes::JSUncatchableError, "sleep was interrupted by kill");
- }
-
- return;
- }
-
uassert(ErrorCodes::JSUncatchableError,
"sleep was interrupted by kill",
!_sleepCondition.wait_for(