[SERVER-6216] add a killAllOps command WAS: Add 'Kill All Ops' feature in shell Created: 26/Jun/12  Updated: 05/Apr/17  Resolved: 16/May/16

Status: Closed
Project: Core Server
Component/s: Admin
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Minor - P4
Reporter: David K. Storrs Assignee: DO NOT USE - Backlog - Platform Team
Resolution: Won't Fix Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
is documented by DOCS-9035 add a killAllOps command WAS: Add 'Ki... Closed
Backwards Compatibility: Fully Compatible
Participants:

 Description   

I used the following code to kill all ops and thereby terminate a long-running map reduce. It would be handy if this could be done as a built-in shell command. Perhaps: db.killAllOps()

Code:

function killAllOps() {
ops = db.currentOp()
ops.inprog.forEach(function(o)

{ db.killOp(o.opid) }

)
}



 Comments   
Comment by Mira Carey [ 16/May/16 ]

While a number of users have needed a "kill long running ops" helper for the shell in the past, it's clear that there's a bit of nuance required. Without white-listing for certain kinds of jobs in replication and sharding, this sort of kill is a bit dangerous, and most users seem to want to kill long running jobs, rather than whatever happens to be occurring.

Given the wide range of requirements and the fact that it can be worked around in JS in the shell, we won't be doing anything at this time.

Generated at Thu Feb 08 03:11:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.