void KillCurrentOp::checkForInterrupt(bool heedMutex) { Client& c = cc(); if (heedMutex && Lock::somethingWriteLocked() && c.hasWrittenSinceCheckpoint()) { return; } uassert(ErrorCodes::InterruptedAtShutdown, "interrupted at shutdown", !_globalKill); if (c.curop()->maxTimeHasExpired()) { c.curop()->kill(); notifyAllWaiters(); uasserted(ErrorCodes::ExceededTimeLimit, "operation exceeded time limit"); } MONGO_FAIL_POINT_BLOCK(checkForInterruptFail, scopedFailPoint) { if (opShouldFail(c, scopedFailPoint.getData())) { log() << "set pending kill on " << (c.curop()->parent() ? "nested" : "top-level") << " op " << c.curop()->opNum().get() << ", for checkForInterruptFail"; c.curop()->kill(); } } if (c.curop()->killPending()) { notifyAllWaiters(); uasserted(11601, "operation was interrupted"); } }
void KillCurrentOp::checkForInterrupt(bool heedMutex) { Client& c = cc(); if (heedMutex && Lock::somethingWriteLocked() && c.hasWrittenThisPass()) { return; } if (_globalKill) { uasserted(11600, "interrupted at shutdown"); } if (c.curop()->maxTimeHasExpired()) { c.curop()->kill(); notifyAllWaiters(); uasserted(16986, "operation exceeded time limit"); } if (c.curop()->killPending()) { notifyAllWaiters(); uasserted(11601, "operation was interrupted"); } }