Re: problems with spawning new subprocesses with development server

2007-05-08 Thread [EMAIL PROTECTED]
Ok, it seems that the problem is not exactly what it seemed in the beginning. Namely: the process is created and works fine, _but_ the django still hangs on returning the http response. In other words (OS = Linux): views.py: def test(request): FNULL = open('/dev/null', 'w') Popen(["test.p

Re: problems with spawning new subprocesses with development server

2007-05-08 Thread Austin Bingham
Sorry for kinda jumping in the middle here, but have you tried fork/exec? It's odd that spawn with NOWAIT isn't giving you what you want, and I'm curious as to whether you can provide more details. In any event, though, fork/exec is a somewhat more verbose way of getting basically the same result.

Re: problems with spawning new subprocesses with development server

2007-05-08 Thread Joseph Heck
Sounds cool to me. If you come up with a solution thats lightweight, I'd be very interested to know what you used and what it took to set up. -joe On 5/8/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Ok, in your case I would (and actually am) rather use some kind of > batching system (tor

Re: problems with spawning new subprocesses with development server

2007-05-08 Thread Rafael \"SDM\" Sierra
On 5/8/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > What about Windows? Linux is for production, but development is on > Windows machines. os.fork is platform independent, so it must work Maybe you'll need to implement SIGCHLD handler to avoid "s" process -- Rafael "SDM" Sierra --~--~-

Re: problems with spawning new subprocesses with development server

2007-05-08 Thread [EMAIL PROTECTED]
What about Windows? Linux is for production, but development is on Windows machines. On May 8, 8:20 pm, Mikhail Gusarov <[EMAIL PROTECTED]> wrote: > Twas brillig at 17:17:58 08.05.2007 UTC+00 when [EMAIL PROTECTED] did gyre > and gimble: > > i> And it seems really strange that it's not a trivia

Re: problems with spawning new subprocesses with development server

2007-05-08 Thread Mikhail Gusarov
Twas brillig at 17:17:58 08.05.2007 UTC+00 when [EMAIL PROTECTED] did gyre and gimble: i> And it seems really strange that it's not a trivial task just to spawn a i> child process and continue the parent. I have a feeling that it is still i> perfectly doable. os.fork + os.execve in child pr

Re: problems with spawning new subprocesses with development server

2007-05-08 Thread [EMAIL PROTECTED]
Ok, in your case I would (and actually am) rather use some kind of batching system (torque in my case). But the problem is that I would very much have a version of the system, when only one machine is available that would do all the work on the background with perhaps some lower priority. And it s

Re: problems with spawning new subprocesses with development server

2007-05-08 Thread Joseph Heck
For a light (i.e. short) duration process that you want results from to return to the user, it's fairly straightforward. Here's some code we're using to report our current code revision in an admin dashboard: def get_code_revision(): import os x = os.popen("/usr/bin/svnversion /u/django/w

problems with spawning new subprocesses with development server

2007-05-08 Thread [EMAIL PROTECTED]
Hi I've spent quite a lot of time trying to simply spawn a new process (by spawn I mean os.P_NOWAIT). The problem is that I cannot manage to get django not to halt after the execution of the process spawning command (the idea is that in views I want to start a background process that is quite tim