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

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

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 0.3.3
    • 0.3.2
    • None
    • None
    • linux 64, python 2.7.8, motor 0.3.2

    Description

      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.

      Attachments

        Activity

          People

            jesse@mongodb.com A. Jesse Jiryu Davis
            WeirdCarrotMonster Eugene Protozanov [X]
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: