Memory leak if exception is raised in cursor's each() callback

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 0.3.3
    • Affects Version/s: 0.3.2
    • Component/s: None
    • None
    • Environment:
      linux 64, python 2.7.8, motor 0.3.2
    • None
    • None
    • None
    • None
    • None
    • None

      Leak can be reproduced in following example:

      #!/usr/bin/env python2
      # -*- coding: utf-8 -*-
      
      from tornado.ioloop import IOLoop, PeriodicCallback
      import motor
      
      loop = IOLoop.instance()
      
      def each(result, error):
      	raise Exception()
      
      def test_callback():
      	con = motor.MotorClient("mongodb://admin:password@127.0.0.1:27017/admin")
      	cursor = con.test.test.find({})
      	cursor.each(callback=each)
      
      
      clbk = PeriodicCallback(test_callback, 1000)
      clbk.start()
      
      
      loop.start()
      

      No exception shows, does not reproduce with other tornado functions that support callbacks.

              Assignee:
              A. Jesse Jiryu Davis
              Reporter:
              Eugene Protozanov [X]
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: