[Python-bugs-list] [ python-Bugs-583975 ] gethostbyaddr lag

noreply@sourceforge.net noreply@sourceforge.net
Sat, 20 Jul 2002 14:03:28 -0700


Bugs item #583975, was opened at 2002-07-19 20:41
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=583975&group_id=5470

Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Jason R. Mastaler (jasonrm)
Assigned to: Nobody/Anonymous (nobody)
Summary: gethostbyaddr lag

Initial Comment:
For more info, also see
http://mail.python.org/pipermail/python-list/2002-July/113706.html
 
Perl's gethostbyaddr doesn't seem to have this problem
as shown
below.  Should I report this in the bug tracker?
 
$ time perl -MSocket -lwe 'print +(gethostbyaddr
inet_aton("datavortex.net"), AF_INET)[0]'
datavortex.net
 
real    0m0.063s
user    0m0.050s
sys     0m0.010s
 
$ time python2 -c 'from socket import * ; print
gethostbyaddr("datavortex.net")[0]'
datavortex.net
 
real    0m20.176s
user    0m0.070s
sys     0m0.020s
 


----------------------------------------------------------------------

>Comment By: Jack Jansen (jackjansen)
Date: 2002-07-20 23:03

Message:
Logged In: YES 
user_id=45365

Here's a few ideas on debugging this:
- Easiest would be if you have a system call tracer. Attach it to the process and see during what system call the 20 second wait occurs. Then look at it's parameters and see whether there's anything fishy. Or whether you can recreate the problem in C.
- If you don't have a tracer first split the program in two steps: the implicit gethostbyname() step and the gethostbyaddr() step. see which one is the problem. Run this step under the debugger and see where the delay is. Again, try to recreate the problem.

----------------------------------------------------------------------

Comment By: Neal Norwitz (nnorwitz)
Date: 2002-07-20 18:02

Message:
Logged In: YES 
user_id=33168

Does this happen consistently (every run) or only the first
time?
Works fine for me (Linux).  What OS are you on?

----------------------------------------------------------------------

Comment By: Jason R. Mastaler (jasonrm)
Date: 2002-07-19 23:46

Message:
Logged In: YES 
user_id=85984

I'm not ruling it out that it could be a local configuration
problem,
it's just that Python is the only application experiencing
this delay.

We've gone through the network configuration and everything
seems
sound, so I'm not sure what more to do.

/etc/resolv.conf is fine -- all entries are operational
nameservers.


----------------------------------------------------------------------

Comment By: Jack Jansen (jackjansen)
Date: 2002-07-19 23:42

Message:
Logged In: YES 
user_id=45365

This smells like a local configuration bug on your system, on my system it works fine (0.220u 0.110s 0:01.85 17.8%     0+0k 84+10io 0pf+0w). Look in your /etc/resolv.conf (or similar file for your platform) to see that there aren't any non-existing hosts listed there.

Although, of course, that doesn't explain why perl has no delay...

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=583975&group_id=5470