[SERVER-10382] Interrupted count commands don't return an error code Created: 31/Jul/13  Updated: 11/Jul/16  Resolved: 04/Oct/13

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 2.4.5
Fix Version/s: 2.5.3

Type: Bug Priority: Major - P3
Reporter: Nelson Elhage Assignee: Randolph Tan
Resolution: Done Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Tested on Ubuntu Linux 12.04 Precise, amd64


Issue Links:
Duplicate
is duplicated by SERVER-15141 stale config error flattened when thr... Closed
Related
related to SERVER-2212 Server automatically abort queries/co... Closed
is related to SERVER-11035 count10.js failing on some Enterprise... Closed
is related to SERVER-15141 stale config error flattened when thr... Closed
Operating System: ALL
Steps To Reproduce:
  • Start a long-running count() (e.g. an unindexed count on a large collection)
  • Find the count in db.currentOp() from a mongo shell, and db.killOp() it
  • Inspect the error result object returned to the client, note the lack of a "code" field.
Participants:

 Description   

If a count is interrupted (by a db.killOp()), the response to the client indicates failure and has an "errmsg" of "11601 operation was interrupted", but does not contain an error code. This is unfortunate for code that wants to determine if a failure was due to some kind of transient database failure, or deliberate termination by an administrator or sweeper (in which case it should not be retried)

This happens because CmdCount::run() calls into runCount(ns.c_str(), cmdObj, err, errCode), but then discards the value errCode, instead of storing it into the result.



 Comments   
Comment by auto [ 03/Oct/13 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-10382 add error code if count command is interrupted

Signed-off-by: Matt Kangas <matt.kangas@mongodb.com>
Branch: master
https://github.com/mongodb/mongo/commit/1819d0083db9d71560a886598a245f12704d4403

Comment by J Rassi [ 10/Sep/13 ]

Linking to SERVER-2212 – also affects count commands run with maxTimeMS.

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