==> Regarding Re: [autofs] [RFC] rpc_ping and looong timeouts; [EMAIL PROTECTED] adds:

raven> On Fri, 4 Jun 2004, Jeff Moyer wrote: A couple of things ...

>>
jmoyer> I've strace'd the automount process, and a lot of time is spent in
jmoyer> the clnt_create, for both UDP and the TCP.  I implemented a
jmoyer> non-blocking connect, and it took my ls time down from 8m21s to
jmoyer> 2m4s.  I'm still looking into why the UDP stuff isn't timing out
jmoyer> sooner.
>> The clnt_create call does not take a timeout.  One of the things it does
>> is to contact the remote portmapper to get the port for the specified
>> program number.  There is a hard-coded default timeout in that code of
>> 60 seconds, which explains my 2 minutes.
>> 
>> This patch simply implements an icmp ping (code shamelessly stolen from
>> clumanager), and does this before even attempting to do the rpc pings.
>> If the icmp ping works, then we continue as usual.  This takes care of
>> the host down case quite nicely:
>> 
>> One nit: icmp_ping_host takes a char * for the hostname, whereas
>> rpc_ping passes a const char *.  As such, we get a 'discards qualifier'
>> warning.  I didn't think it warrented converting the whole call chain to
>> consts, but if you're especially concerned about that, Ian, I'd be happy
>> to resubmit.

raven> I've put a cast in to eliminate the warning.

raven> I added the Makefile glue and ...

Whoops, I can't believe I left that out!  Sorry!

raven> I noticed that, for the case the request is not a replicated server
raven> entry a mount is still attempted so I added a ping check.

raven> I've attached the complete patch but here is what I added. Can you
raven> test it in your environment before I commit it please:

Yes, that looks correct to me.  I tested it with the same test case I was
using before, and all is well.  One thing:

  mount_nfs.c: In function `get_best_mount':
  mount_nfs.c:232: warning: implicit declaration of function `icmp_ping_host'

You forgot to #include "ping.h"!  Maybe between the two of us we'll get
this right.  ;)

Thanks, Ian!

Jeff

_______________________________________________
autofs mailing list
[EMAIL PROTECTED]
http://linux.kernel.org/mailman/listinfo/autofs

Reply via email to