jabber.client.IQ memory-leaks like a dead GI's helmet.

[email protected] Wed, 24 Feb 2010 17:06:22 -0000
Newsgroups gmane.comp.python.twisted.bugs
Message-ID <[email protected]>
New submission from alsuren <None>:

If no callbacks are registered, the IQ still registers an observer. While this is only in theory a small, temporary leak, there doesn't seem to be a way to specify a timeout, so a remote user can trick us into OOMing ourselves by eg failing to reply to jingle IQs (We found this when load testing http://telepathy.freedesktop.org/wiki/Fargo with lazy test scripts)

Also, when registering the observer, it passes in a string. This string gets turned into an xpath query object and interned. Because each iq's id is unique, this interned query is guaranteed to never be used again. Please construct a query object manually so that it doesn't get interned.

work-around:
Don't use IQ, and construct domish.Elements by hand instead. This is what we ended up doing in Fargo. We still need to add the appropriate code for relaying IQ errors to jingle call objects. Might implement it by keeping a WeakValueDict of id->channel or something to avoid leaks.


----------
Type     : defect
Component: words
Keywords : 
Priority : low
Nosy     : 
----------
http://twistedmatrix.com/trac/ticket/4313