Exemplo n.º 1
0
bool ServiceContextMongoD::_killOperationsAssociatedWithClientAndOpId_inlock(Client* client,
                                                                             unsigned int opId) {
    OperationContext* opCtx = client->getOperationContext();
    if (!opCtx) {
        return false;
    }
    if (opCtx->getOpID() != opId) {
        return false;
    }
    _killOperation_inlock(opCtx);
    return true;
}
Exemplo n.º 2
0
bool ServiceContextMongoD::killOperation(unsigned int opId) {
    for (LockedClientsCursor cursor(this); Client* client = cursor.next();) {
        stdx::lock_guard<Client> lk(*client);

        OperationContext* opCtx = client->getOperationContext();
        if (opCtx && opCtx->getOpID() == opId) {
            _killOperation_inlock(opCtx, ErrorCodes::Interrupted);
            return true;
        }
    }

    return false;
}
Exemplo n.º 3
0
void ServiceContextMongoD::killAllUserOperations(const OperationContext* txn,
                                                 ErrorCodes::Error killCode) {
    for (LockedClientsCursor cursor(this); Client* client = cursor.next();) {
        if (!client->isFromUserConnection()) {
            // Don't kill system operations.
            continue;
        }

        stdx::lock_guard<Client> lk(*client);
        OperationContext* toKill = client->getOperationContext();

        // Don't kill ourself.
        if (toKill && toKill->getOpID() != txn->getOpID()) {
            _killOperation_inlock(toKill, killCode);
        }
    }
}