whackanop
whackanop
monitors mongodb for long-running operations, killing any that it finds.
Motivation
See this blog post.
Or this StackExchange post.
Usage
$ whackanop -h
Usage of whackanop:
-debug=true: in debug mode, operations that match the query are logged instead of killed
-interval=1: how often, in seconds, to poll mongo for operations
-mongourl="mongodb://localhost?connect=direct": mongo url to connect to. Must specify connect=direct to guarantee admin commands are run on the specified server.
-query="{\"op\": \"query\", \"secs_running\": {\"$gt\": 60}}": query sent to db.currentOp()
-verbose=false: more verbose logging
-version=false: print the version and exit
Installation
Install from source via go get github.com/Clever/whackanop
, or download a release on the releases page.
Local Development
Set this repository up in the standard location in your GOPATH
, i.e. $GOPATH/src/github.com/Clever/whackanop
.
Once this is done, make test
runs the tests.
The release process requires a cross-compilation toolchain.
gox
can install the toolchain with one command: gox -build-toolchain
.
From there you can build release tarballs for different OS and architecture combinations with make release
.
Rolling an official release
Official releases are listed on the releases page.
To create an official release:
-
On master
, bump the version in the VERSION
file in accordance with semver.
You can do this with gitsem
, but make sure not to create the tag, e.g. gitsem -tag=false patch
.
-
Push the change to Github. Drone will automatically create a release for you.
Vendoring
Please view the dev-handbook for instructions.