From: Vlad S. <vl...@cr...> - 2006-09-14 18:04:19
|
Can i do this from other thread, spawn in one and check in another, actually this is what i need. I can have multiple processes running, then according to some rules i will check which one is taking too long and kill it. Zoran Vasiljevic wrote: > On 14.09.2006, at 19:50, Vlad Seryakov wrote: > >> The only immediate request i would have for ns_proxy to be able to >> query >> pid for active proxies, may be ns_proxy active could return pid or >> other >> command, that will be useful for forcing process exit if necessary. > > You can do: > > ns_proxy clear ?pool? > > to forcefully clear _all_ slave processes (or just > ones for the given pool). > > But look here: > > server1:nscp 1> set proxy [ns_proxy get pool] > > zvpb:~ zoran$ ps -ax | grep proxy > 13423 p0 S+ 0:00.02 /usr/local/ns/bin/nsproxy pool pool-7 > 13425 p2 S+ 0:00.01 grep proxy > > Now we have a slave process running. So: > > server1:nscp 2> ns_proxy send $proxy "exec sleep 10000" > server1:nscp 3> ns_proxy wait $proxy 1000 > could not wait for proxy "pool-7": timeout waiting for evaluation > > zvpb:~ zoran$ ps -ax | grep proxy > 13423 p0 S+ 0:00.02 /usr/local/ns/bin/nsproxy pool pool-7 {exec > sleep 10000} > > Now you have the slave "gone wild". How to get rid > of it? Simply: > > server1:nscp 4> ns_proxy put $proxy > > and hopla: > > [14/Sep/2006:19:58:11][13419.41968128][-nsproxy:reap-] Warning: > [pool]: pid 13423 won't die, send signal 15 > [14/Sep/2006:19:58:12][13419.41968128][-nsproxy:reap-] Error: process > 13423 killed with signal 15 (Terminated) > > and: > > zvpb:~ zoran$ ps -ax | grep proxy > 13430 p2 R+ 0:00.00 grep proxy > > This is NEW in the code. If your proxy is just taking too > much time, you return it back to the pool. The code will > see that you are returning an non-idle proxy back to pool > and will assure to kill the slave. > > Is this what you are looking for? > > Cheers, > Zoran > > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > naviserver-devel mailing list > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-devel > -- Vlad Seryakov 571 262-8608 office vl...@cr... http://www.crystalballinc.com/vlad/ |