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

Interrupted count query returns 0 as count result

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.8.2
    • Component/s: Querying
    • Labels:
      None
    • Environment:
      Linux nb-lkoopmann 2.6.35-30-generic #56-Ubuntu SMP Mon Jul 11 20:01:08 UTC 2011 x86_64 GNU/Linux
    • ALL

      When interrupting a count query (for example in the mongo shell with killOp()) there is no exception raised but 0 returned as the count result. The count query should also raise an exception instead of returning 0, what might be interpreted as a valid result.

      I performed these queries in the mongo shell and killed them in another shell - You can see the difference between all three types of queries:

      > db.messages.distinct({foo : "bar"})
      Tue Aug 23 18:51:00 uncaught exception: distinct failed: { "errmsg" : "exception: interrupted", "code" : 11601, "ok" : 0 }
      > db.messages.find({foo : "bar"})    
      error: { "$err" : "interrupted", "code" : 11601 }
      > db.messages.count({foo : "bar"})
      0
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            lennartkoopmann Lennart Koopmann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: