I'm a Turkey.  "dbserver" should be "localhost".  Having looked at all
sorts of things, including "telnet localhost", I just did not see it.

There is in fact no machine called dbserver.  It would, of course, be
nice to get a dnslookup error rather than just hang.  But that is not
the way that the C-Grade code in operating systems works!  

If Socket could print some sort of message for timeout vs simply no port
listener that would be good, but I suspect that it cannot.

Thanks for your reply, and sorry to bother you.

Anthony

> -----Original Message-----
> From: Steve Loughran [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, April 17, 2007 7:09 PM
> To: Ant Users List
> Subject: Re: Bug: waitfor waits too long, too slow
> 
> Berglas, Anthony wrote:
> > Hello All,
> >
> > I have the following fragment in a build that restarts tomcat
> >         <waitfor>
> >             <not>
> >                 <socket server="dbserver" port="8080"/>
> >             </not>
> >         </waitfor>
> >
> > The trouble is that it takes about 30 seconds to run, even if Tomcat
has
> > not run for a while, and there is nothing port 8080 at all.
> >
> > This is on Windows XP.
> >
> > Setting checkevery does not help.
> >
> > The following netstats were done before, during (two) and after the
> > waitfor.
> >
> > C:\Documents and Settings\aberglas>netstat -ao | findstr 8080
> >
> > C:\Documents and Settings\aberglas>netstat -ao | findstr 8080
> >   TCP    aberglas-pc:2520       10.16.172.13:8080      SYN_SENT
> > 2444
> >
> > C:\Documents and Settings\aberglas>netstat -ao | findstr 8080
> >   TCP    aberglas-pc:2520       10.16.172.13:8080      SYN_SENT
> > 2444
> >
> > C:\Documents and Settings\aberglas>netstat -ao | findstr 8080
> >
> > (If Tomcat had been run recently, there can be some TIME_WAITS as
well,
> > but I think that that is quite irrelevant.  In any case the problem
is
> > still there if there are no TIME_WAITS as demonstrated above.)
> >
> > Feels like this is a bug, in ant or windows.  I've needed to replace
> > waitfor with a sleep, which is unfortunate.  Any help appreciated
> 
> It could be a quirk of networking -30s sounds like a timeout on the
lan,
> and the SYN_SENT packet implies it isnt DNS that is causing the delay.
> 
> If your server has a firewall and is dropping all incoming packets,
then
> the build wont know that the socket isnt there until it gives up.
> 
> 1. test with a manual "telnet dbserver 8080" and see how long that
takes
> to terminate. A quick rejection=good, 30s delay=bad
> 
> 2. try opening the firewall on that port, so that the manual telnet
> fails fast, instead of slow
> 
> 3. maybe we could fiddle with socket.setSoTimeout in the condition,
but
> this is only something that could be done in a future version of ant.
> you are best off fixing your firewall.
> 
> 
> 
> 
> > A related feature request, is that it would be good to be able to
wait
> > for a file lock to be removed on windows.  Or to be able to put a
time
> > out on delete.
> 
> well, if you can find a way to reliably implement it, I'm sure we
could
> add a new condition.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to