Mailing List Archive

Problem trying to spawn (fork) asynchronous process from cgi IGNORE EARLIER POST, PROBLEM SOLVED
I found the answer, I needed to close std[in,err,out] in the cgi script as
well.

Sorry for wasting bandwidth.

Gary


Gary Pennington wrote:

> 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