[Freeipa-devel] Wrong timeout parameter in ipapython

Sylvain Baubeau bob at glumol.com
Fri Mar 11 10:20:00 UTC 2011


Yes, I'm using IPv4.
It's even worse as the constant 'io.PR_AF_INET' (whose value is 2) is 
used in this case :)

Regards
Sylvain

Le 11/03/2011 10:59, Jakub Hrozek a écrit :
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 03/11/2011 04:44 AM, Rob Crittenden wrote:
>    
>> Sylvain Baubeau wrote:
>>      
>>>     Hi,
>>>
>>> I was facing an error with ipapython that caused an NSPRError
>>> exception to
>>> be raised at line 159 of ipapython/nsslib.py :
>>>
>>> 157                 logging.debug("connecting: %s", net_addr)
>>> 158                 try:
>>> 159                     self.sock.connect(net_addr, family)
>>> 160                 except Exception, e:
>>> 161                     logging.debug("Could not connect socket to %s,
>>> error: %s, retrying..",
>>> 162                                   net_addr, str(e))
>>>
>>> The error message was : [Errno -5990] (PR_IO_TIMEOUT_ERROR) I/O operation
>>> timed out.
>>>
>>> It seems like the second argument to 'connect' is a timeout, not the
>>> socket family. I attached a patch that just removes the second argument.
>>> Or am I missing something ?
>>>
>>> Regards
>>> Sylvain Baubeau
>>>        
>> I'll do a full review tomorrow but it looks like you are correct, this
>> is timeout not family. Under what conditions were you getting the
>> timeout? Are you using IPv4 or IPv6 addresses?
>>
>> thanks
>>
>> rob
>>
>>      
> Sylvain's patch is correct, Ack.
>
> The address family is correctly passed during socket creation. It should
> not be used during connection. The code worked for us by accident only
> as the family is an integer, too.
>
> Since he's getting timeouts, I'm guessing he's using IPv4 because
> AF_INET = 4, AF_INET6 = 10.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (GNU/Linux)
> Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk158moACgkQHsardTLnvCWHswCgsgeA9TFajU97l3muzzI41u3P
> 3r8Anim/lNufnsRWklvsOT2w3O0eq4Rf
> =CDAl
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Freeipa-devel mailing list
> Freeipa-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/freeipa-devel
>    




More information about the Freeipa-devel mailing list