Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-780

ExecutionTimeout behaviour not as advertised.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: 2.7, 2.7.2
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Environment:
      Mac OS X 10.10, mongod 2.6.5, Python 3.4.2

      Description

      Examining the test suite for PyMongo I see a test using max_time_ms and trapping an ExecutionTimeout exception when calling cursor.next() or list(cursor). In my own testing I have never been able to get find queries I run to generate this exception; they wait and time out in the given period of time, but they instead simply raise StopIteration without any way to identify if is due to a timeout or simply running out of data. This is especially critical for my use of capped collections as a queue.

      My test case:

      	import pymongo
      	
      	db = pymongo.Connection().test
      	
      	db.sample.drop()
      	db.create_collection('sample', capped=True, size=4 * 1024 * 1024, max=5000)
      	
      	collection = db.sample
      	collection.insert({'nop': True})  # Capped collections need one value before you can tail them.
      	
      	cursor = collection.find({}, tailable=True, await_data=True).max_time_ms(2 * 1000)
      	
      	__import__('pprint').pprint(list(cursor))  # Should explode with ExecutionTimeout.

        Attachments

          Activity

            People

            Assignee:
            jesse A. Jesse Jiryu Davis
            Reporter:
            amcgregor Dissatisfied Former User
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: