Re: Apache SAPI screwed up
| From: | Zeev Suraski | Date: | Sat, 08 Jul 2000 15:21:41 +0000 |
| Subject: | Re: Apache SAPI screwed up | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-23868@lists.php.net to get a copy of this message | ||
Ah. Apache changed it's behavior since adding the child exit hooks, and
no longer calls the shutdown hooks when a single server exits? If so, we
indeed have a bug.
The bug should be solved by simply calling the shutdown hook on child
exit, in addition to calling it on the server shutdown. Generally,
there's no reason to get confused with the GINIT/GSHUTDOWN functions at
all; The fact we prepare a single process image, start it up, and then
Apache forks the already-prepared image is great, and is the quickest (and
IMHO the cleanest) way of doing things. We just need to ensure it also
cleans this process up on every exit.
Zeev
On Sat, 8 Jul 2000, Andreas Karajannis wrote:
> Hi all,
>
> after some experiments I've made I believe that the apache SAPI module
> needs some rewrite.
> This is surely due to apache's weird module initialization api,
> nevertheless PHP's module initialization / cleanup is also screwed up
> which seems to lead to problems with certain modules.
>
> The MINIT/MSHUTDOWN routines only get called for the main apache
> process, but due to the apache way of doing things, twice (At least
> under Unix).
>
> I think this is the cause for problems with persistent database
> connections that don't get closed properly on child exit, since the
> MSHUTDOWN function is not called in this situation - see e.g. Bug #5474.
>
> IMHO at least the the MSHUTDOWN functions should be additionally hooked
> to apache's childexit handlers.
> The MINIT handlers could be hooked to childinit, but I don't see a need
> for this.
>
> Additionally, GSHUTDOWN handlers should be called after MSHUTDOWN in the
> main process, right now, they don't get called at all.
> There is no easy way to avoid the two rounds of module
> initialization/shutdown on apache startup except by using EAPI, but I
> see this as a more "cosmetical" issue.
>
> The cleanest approach would be to have GINIT/GSHUTDOWN called only in
> the main apache process and the MINIT/MSHUTDOWN in every child process,
> but this could cause undesireable side effects.
>
>
> -Andreas
>
>
--
Zeev Suraski <zeev@zend.com>
http://www.zend.com/