Uploaded image for project: 'Motor'
  1. Motor
  2. MOTOR-45

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

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

      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:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            WeirdCarrotMonster Eugene Protozanov [X]
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: