pika: Tornado ioloop._Timeout grows with every request

This is a strange one that I’ve been digging into for days. At first, I thought it was completely unrelated to Pika but I’ve narrowed things down quite a bit to the point where commenting-out my TornadoConnection() prevents the problem from happening.

My setup is completely based on the Tornado Consumer example.

My setup is that I’m running a Tornado API and call the consumer run() method from an ioloop_instance.add_timeout() call with time.time()+1, which happens as soon as I start the ioloop immediately after.

If I do the above, each call to my API adds 2 additions to tornado.ioloop._Timeout. If I skip initializing my Pika consumer (or simply comment-out the TornadoConnection in it), everything is fine.

The concern here is that I’m experiencing a pretty hefty memory leak, based on traffic.

Tornado: 4.0.2 Pika: 0.9.14 (Edit: Just tried 0.10.0 with same result)

Any ideas?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 16 (4 by maintainers)

Most upvoted comments

the ioloop’s _timeouts list contains _Timeout objects. _Timeout objects have deadline, callback, and tiebreaker attributes. the _timeouts list will definitely contain non-None objects, but those objects (in the case of the http request 1hr timeout) will have their callback attribute set to None once the request is served. are you sure youre not thinking about the _Timeout object?