Z W wrote:
Hi

I'm trying to "ping" hosts on network using <isreachable> with ant-contrib.
All these hosts variables point to the same host ie linpac2.


[echo] start isreachable linpac2

Dynamically discovered 'isreachable'
[EMAIL PROTECTED]

Probing host linpac2

Unknown host: linpac2

Condition false; not setting offline

[echo] build_main.debug=0

[sleep] sleeping for 5000 milliseconds

Why on both consecutive "pinging" to the same host, it works the first time
but not the second ?


I'm the author of that task, so blame me.
Here's the source
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/IsReachable.java?view=markup

-isreachable uses Sun's API InetAddress.isReachable() , the exact behaviour of which is undocumented (they dont say how it pings)

If its playing up, its probably the implementation. I see that java 6.4 mentions three fixes for this

6587875 java classes_net InetAddress.isReachable() will not work for super users with "large" process ids 6599750 java classes_net InetAddress.isReachable implementation not completely thread safe 6601686 java classes_net InetAddress.isReachable(timeout) may not return after timout milliseconds

1. please open a bugrep on issues.apache.org/bugzilla
2. try with the latest sun JVM update; if it goes away, then we've found the problem

I've found I dont use the condition much, because
 -some of the hosts I deploy to have ping locked down
 -it doesnt go through firewalls
 -when a machine is booting up, ping starts ahead of the services I need

I prefer to use <http> and <socket>. Could they work for you ?

--
Steve Loughran                  http://www.1060.org/blogxter/publish/5
Author: Ant in Action           http://antbook.org/

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

Reply via email to