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

ExecutionTimeout behaviour not as advertised.

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.7, 2.7.2
    • Component/s: None
    • Labels:
    • Environment:
      Mac OS X 10.10, mongod 2.6.5, Python 3.4.2

      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.
      

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            alice@gothcandy.com Dissatisfied Former User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: