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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 0.3.2
    • Fix Version/s: 0.3.3
    • Component/s: None
    • Labels:
      None
    • Environment:
      linux 64, python 2.7.8, motor 0.3.2
    • # Replies:
      8
    • Last comment by Customer:
      true

      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

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since reply:
                4 years, 6 weeks ago
                Date of 1st Reply: