[Twisted-Python] Re: twisted-names: Cryptic error with no traceback?

Jean-Paul Calderone exarkun at divmod.com
Tue Feb 27 18:07:17 MST 2007


On Tue, 27 Feb 2007 15:18:26 -0500, Paul Marks <pmarks at purdue.edu> wrote:
>On 2/27/07, Paul Marks <pmarks at purdue.edu> wrote:
>>Some users of a program that I'm writing have been reporting this
>>error that I so far have been unable to track down.  It seems that it
>>originates from Twisted, but that it skips around my errback handler,
>>and provides no traceback information:
>>
>>       Traceback (most recent call last):
>>       Failure: twisted.names.error.DNSQueryTimeoutError:
>>
>>
>>My query is made from line 121 here:
>>http://dtella.svn.sourceforge.net/viewvc/dtella/tags/1.0.2/dtella_dnslookup.py?revision=406&view=markup
>>
>>Does anyone have any insight as to where this error could be coming
>>from, and why it isn't getting trapped by my errback function?  I
>>don't know yet whether this is a problem in Twisted, or if I'm doing
>>something incorrect in my err_cb.
>
>Update:
>Yay, I finally found the bug!  Turns out it's a problem in Twisted.
>
>Inside DNSDatagramProtocol.writeMessage, it writes to the UDP socket,
>and never checks for socket.error.
>
>If a socket.error does occur, then the query() function blows up
>instead of returning its deferred.  So, cancelCall gets forgotten.  A
>few seconds later, it chucks a DNSQueryTimeoutError, and the deferred
>gets garbage collected without anything handling it.

What socket.error are you seeing?

Jean-Paul




More information about the Twisted-Python mailing list