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

Jean-Paul Calderone exarkun at divmod.com
Tue Feb 27 20:07:17 EST 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:
>>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.
>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?


More information about the Twisted-Python mailing list