Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-10382

Interrupted count commands don't return an error code

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.4.5
    • Fix Version/s: 2.5.3
    • Component/s: Querying
    • Labels:
    • Environment:
      Tested on Ubuntu Linux 12.04 Precise, amd64
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide
      • 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.
      Show
      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.

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              renctan Randolph Tan
              Reporter:
              nelhage Nelson Elhage
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: