Skip to content

[mongo] Use db.current_op instead of manually querying#3016

Merged
olivielpeau merged 1 commit into
DataDog:masterfrom
ebroder:mongo
Nov 11, 2016
Merged

[mongo] Use db.current_op instead of manually querying#3016
olivielpeau merged 1 commit into
DataDog:masterfrom
ebroder:mongo

Conversation

@ebroder

@ebroder ebroder commented Nov 10, 2016

Copy link
Copy Markdown
Contributor

What does this PR do?

MongoDB 3.2 introduced a new find command, which standard query
operations in pymongo will use if it's available. That command doesn't
support the legacy $cmd.sys.inprog pseudo-collection, which is
replaced by a currentOp command.

Fortunately there's a built-in API to handle this. Use it.

Motivation

Based on f6b0742#commitcomment-19773690, this is currently broken under newer versions of MongoDB.

Testing Guidelines

An overview on testing
is available in our contribution guidelines.

Additional Notes

Anything else we should know when reviewing?

@yannmh

yannmh commented Nov 10, 2016

Copy link
Copy Markdown

@ebroder I believe it's fixed with #3015.

Although, your solution seems shorter :), would you mind rebasing it on master to be able to merge it please?

MongoDB 3.2 introduced a new find command, which standard query
operations in pymongo will use if it's available. That command doesn't
support the legacy `$cmd.sys.inprog` pseudo-collection, which is
replaced by a `currentOp` command.

Fortunately there's a built-in API to handle this. Use it.
@ebroder

ebroder commented Nov 10, 2016

Copy link
Copy Markdown
Contributor Author

Ha! Looks like I just missed that one. Sorry about that, rebased now.

@yannmh

yannmh commented Nov 10, 2016

Copy link
Copy Markdown

Thank you! 🙇

@olivielpeau

Copy link
Copy Markdown
Member

Tests are actually running and passing, merging

@olivielpeau
olivielpeau merged commit 5803682 into DataDog:master Nov 11, 2016
@olivielpeau olivielpeau added this to the 5.10.1 milestone Nov 11, 2016
truthbk pushed a commit that referenced this pull request Nov 15, 2016
MongoDB 3.2 introduced a new find command, which standard query
operations in pymongo will use if it's available. That command doesn't
support the legacy `$cmd.sys.inprog` pseudo-collection, which is
replaced by a `currentOp` command.

Fortunately there's a built-in API to handle this. Use it.
@DevBrent

Copy link
Copy Markdown

Thanks @ebroder

degemer added a commit that referenced this pull request Nov 15, 2016
* master: (254 commits)
  Reduce the maximum amount of argument to pylint.
  [forwarder] stop flushing after 10s
  [etcd] Report errors connecting to etcd endpoint (#3007)
  Postfix check should pass raise_on_empty_output=False
  [status] Silence requests exception
  [psutil] Only set `psutil.PROCFS_PATH` once in the collector (#3013)
  [ci] fix check name detection of test files (#3021)
  [ci][rabbitmq] Increase wait timeout (#3022)
  [core] SpooledTemporaryFile for subprocess output (#3002)
  [collector] isolate system checks (#3001)
  [ci] Fix Travis jobs timing out (#3017)
  [mongo] Use db.current_op instead of manually querying (#3016)
  [ci] fix bad citizens detection (#3020)
  [ci] add debug logs (#3019)
  [mongo] use `currentOp` for mongodb 3.2+
  Use proxy for API key check in info page (#3012)
  [mongo] Add MongoDB 3.2 support
  [mongo] Add MongoDB 3.2 to travis-ci config
  [packaging] 5.11.0 nightlies (#3009)
  [core] hard-deprecate start/stop/restart/status (#3004)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants