On Mon, Jul 16, 2012 at 9:54 PM, Andrew Bennetts <andrew@bemusement.org> wrote:
Dan Stromberg wrote:
[…]
> Can anyone think of other ways of getting to the bottom of this?  Perhaps
> some field in a deferred or deferredList I can introspect to get better
> specifics?
>
> Is monkey patching an identifier of some sort into each deferred
> reasonable?  The intent would be to make it easier to match up the
> lingering DeferredLists with the place they're created.

That's the sort of thing that calling twisted.internet.defer.setDebugging(True)
is meant to help with.  If you turn that on, you can probably introspect the
stuff it creates and use that in your debugging tool.  (That's a bit ugly, but
probably not significantly worse than introspecting other private attributes
Deferred.)

I'm playing with twisted.internet.defer.setDebugging now.

Is there a corresponding function that can be used to produce its report?  If I use it in a program with an infinite loop, it seems like I never get the report, but if I use it in a program with a finite length, I eventually get a useful-looking report.