[PyCS-devel] forking inside a module script
Status: Alpha
Brought to you by:
myelin
|
From: Phillip P. <pp...@my...> - 2003-03-13 10:00:49
|
Hi, I've decided that the safest way to run htsearch is to fork inside the module script, run htsearch in the child process, and let the OS clean up after it. (how to do this in Python, for ppl who're interested: http://www.myelin.co.nz/post/2003/3/13/#200303135) However, I found that the module handler catches SystemExit exceptions, meaning that the child processes weren't being allowed to exit properly. I've changed pycs_module_handler to just re-raise if it gets a SystemExit, but it looks like Medusa also catches it. Here's a quick diff to get Medusa to re-raise too: RCS file: /cvsroot/oedipus/medusa/http_server.py,v retrieving revision 1.10 diff -u -r1.10 http_server.py --- http_server.py 18 Dec 2002 14:55:44 -0000 1.10 +++ http_server.py 13 Mar 2003 09:58:20 -0000 @@ -495,6 +495,8 @@ # This isn't used anywhere. # r.handler = h # CYCLE h.handle_request (r) + except SystemExit: + raise except: self.server.exceptions.increment() (file, fun, line), t, v, tbinfo = asyncore.compact_traceback() I guess we should push this one over to the Medusa people too ... (I haven't put any of the search stuff into CVS yet BTW, but will soonish hopefully). Cheers, Phil |