Re: [Webware-discuss] Dead threads: detection and recovery

2006-06-23 Thread Shayne O'Neill
> Oliver Bock <[EMAIL PROTECTED]> writes: >> >> I've implemented the infinite loop-catching suggestion by instrumenting >> the Python code. I haven't adopted the techniques from the article Ian >> found because I'm lazy, and because my users are silly, not evil. It >> took a bit of buggering abo

Re: [Webware-discuss] Dead threads: detection and recovery

2006-06-22 Thread Shayne O'Neill
>> Why not parse the python code fragments before executing them and insert a >> check for a stop event in the beginning of each loop. It could even force a >> loop counter of some type that would allow the main thread to force the >> worker thread to stop processing through a stop event once a th

Re: [Webware-discuss] Dead threads: detection and recovery

2006-06-22 Thread Richard Wheeler
- Oliver Bock <[EMAIL PROTECTED]> writes: > > I've implemented the infinite loop-catching suggestion by instrumenting > the Python code. I haven't adopted the techniques from the article Ian > found because I'm lazy, and because my users are silly, not evil. It > took a bit of buggering a

Re: [Webware-discuss] Dead threads: detection and recovery

2006-06-22 Thread Oliver Bock
I've implemented the infinite loop-catching suggestion by instrumenting the Python code. I haven't adopted the techniques from the article Ian found because I'm lazy, and because my users are silly, not evil. It took a bit of buggering about but the result is fairly simple. Read on if you're

Re: [Webware-discuss] Dead threads: detection and recovery

2006-06-21 Thread Richard Wheeler
Ian Bicking <[EMAIL PROTECTED]> writes: > This recipe might be of use: > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496746 > > I don't believe it is threadsafe, but I'm not sure. I think it needs to > run the code in the main thread, then puts an alarm in a subthread that > interr

Re: [Webware-discuss] Dead threads: detection and recovery Oliver Bock

2006-06-21 Thread Ian Bicking
Wheeler, Richard wrote: > Why not parse the python code fragments before executing them and insert a > check for a stop event in the beginning of each loop. It could even force a > loop counter of some type that would allow the main thread to force the > worker thread to stop processing through a

Re: [Webware-discuss] Dead threads: detection and recovery

2006-06-21 Thread Oliver Bock
This is a good idea, but a lot of work. (It messes with my head whenever I get into the parse tree stuff.) Oliver -- Wheeler, Richard wrote: > Why not parse the python code fragments before executing them and insert a > check for a stop event in the beginning of each loop. It could even fo

Re: [Webware-discuss] Dead threads: detection and recovery

2006-06-21 Thread Tim Roberts
On Wed, 21 Jun 2006 15:01:03 -0400< "Wheeler, Richard" <[EMAIL PROTECTED]> wrote: >Why not parse the python code fragments before executing them and insert a >check for a stop event in the beginning of each loop. It could even force a >loop counter of some type that would allow the main thread to

Re: [Webware-discuss] Dead threads: detection and recovery Oliver Bock

2006-06-21 Thread Wheeler, Richard
been reached. -Original Message- > [Webware-discuss] Dead threads: detection and recovery Oliver Bock > Mon, 19 Jun 2006 00:50:23 -0700 > > My system allows users to write their own python code fragments for > some tasks. Unfortunately the users sometimes write infinite

Re: [Webware-discuss] Dead threads: detection and recovery

2006-06-20 Thread Oliver Bock
Ian Bicking wrote: > It's been a while since I've been in that code (ThreadedAppServer) but > no, I don't believe there's a way to detect wedged threads. That would > be a nice feature. How about this plan: as each thread starts a request we record the time processing begins in the thread objec

Re: [Webware-discuss] Dead threads: detection and recovery

2006-06-20 Thread Ian Bicking
Oliver Bock wrote: > My system allows users to write their own python code fragments for some > tasks. Unfortunately the users sometimes write infinite loops, which > gradually lock up threads until none remain. A few minutes later a > monitor notices that the system is unresponsive and kills

Re: [Webware-discuss] Dead threads: detection and recovery

2006-06-19 Thread Oliver Bock
Shayne O'Neill wrote: > Does python have a sort of cooperative "pass" command? Whilst little > (other than an external monitoring process, assuming the monitor gets a > chance to do its thing) will stop someone writing this code;- > > while 1==1: > echo "hi mum" > > a call like > > whi

Re: [Webware-discuss] Dead threads: detection and recovery

2006-06-19 Thread Oliver Bock
Ben Parker wrote: > ... If management is > pushing for those kinds of development capabilities in order to drive > their business, you should push back that their requirements demand more > knowledgeable staff. > While I agree with your suggestions, they unfortunately won't fly. Oliver

Re: [Webware-discuss] Dead threads: detection and recovery

2006-06-19 Thread Ben Parker
Oliver Bock wrote on 06/19/2006 05:45 PM: > I think I should explain the system: the software allows the design and > execution of web surveys. The people writing code are constructing > surveys and sometimes need to write Python fragments to decide (for > example) which question is shown next.

Re: [Webware-discuss] Dead threads: detection and recovery

2006-06-19 Thread Shayne O'Neill
Does python have a sort of cooperative "pass" command? Whilst little (other than an external monitoring process, assuming the monitor gets a chance to do its thing) will stop someone writing this code;- while 1==1: echo "hi mum" a call like while 1==1: one_of_our_calls()

Re: [Webware-discuss] Dead threads: detection and recovery

2006-06-19 Thread Oliver Bock
I completely take your point that you cannot stop malicious users abusing scripting facilities. (Although if it weren't for the import statement, I think you could provide a limited set of functions in __globals__ and limit the abuse to overuse of the CPU.) I think I should explain the system:

Re: [Webware-discuss] Dead threads: detection and recovery

2006-06-19 Thread Shayne O'Neill
Or to clarify I mean you cant offer scripting to users, and make it so it cant be abused. One of my old projects was to embed python in the citadel groupware server [fun fact, I got webware working from inside the citadel server] and yeah, couldnt make it secure at all, so ended up with signed

Re: [Webware-discuss] Dead threads: detection and recovery

2006-06-19 Thread Shayne O'Neill
Hmm. Ok. What Im getting at, is that Im presuming that these scripts are at an administrative level? Python absolutely can not be made secure. There where attempts a while back at it, but it was found that it simply cant be done. Oh yeah, totally offtopic, but regarding the 'penis enhancing dr

Re: [Webware-discuss] Dead threads: detection and recovery

2006-06-19 Thread Oliver Bock
> > Without wanting to be rude, but is there a point to the exercise? Of course not. I've got nothing better to do than start mailing list threads. On my weekends I go around and post comments to blogs, advertising penis-enlarging drugs. > ... If this > is a problem then one would presume th

Re: [Webware-discuss] Dead threads: detection and recovery

2006-06-19 Thread Shayne O'Neill
Without wanting to be rude, but is there a point to the exercise? If this is a problem then one would presume that they can just restart the system if it locks and check out the stack dump? On Mon, 19 Jun 2006, Oliver Bock wrote: > My system allows users to write their own python code fragments

[Webware-discuss] Dead threads: detection and recovery

2006-06-19 Thread Oliver Bock
My system allows users to write their own python code fragments for some tasks. Unfortunately the users sometimes write infinite loops, which gradually lock up threads until none remain. A few minutes later a monitor notices that the system is unresponsive and kills and restarts AppServer. T