Problem trying to spawn (fork) asynchronous process from cgi

Gary Pennington Gary.Pennington at uk.sun.com
Tue Aug 17 11:25:54 EDT 1999


Hi,

I'm trying to spawn(Win32 equivalent of fork and exec) a process from
python running under NT using CGI. I've got almost everything correct,
but one last thing is troubling me.

I invoke the script, my background process launches asynchronously(using
hte P_DETACH option to os.spawnve), I display my message in the browser
with successful notification - however the browser thinks that a
transfer is still running and thus continues displaying busy. If you
terminate the transfer, you get a transfer interrupted message in the
browser, other than this there is no impact on the back end server
process.

It looks ugly and is bugging me, so is there a way to stop this
behaviour? I suspected that it was caused by inherited open streams (eg
stdin etc...,) but I closed these down in my forked program (I don't
need them anyway) and that didn't change the problem. Interestingly, the
browser knows that the back-end proces is still running and stops the
transfer activity when the back end process is shut-down.

Thanks for any pointers.

Gary






More information about the Python-list mailing list