On Sun, May 15, 2005 at 09:22:57AM -0400, Jeff Trawick wrote:
...
> >Joe Orton says, "To fix this properly, I suppose piped loggers should not get
> >SIGTERMedduring a graceful restart, they should read till EOF then
> exit(0): then
> >when the last child attached to the piped logger for a particular generation
> >quits, the pipe is closed and the piped logger terminates gracefully too,
> >without losing log messages."
> 
> In that scenario, the patch I've attached here would not normally be
> needed, but would be a backup if that doesn't work.  It is not clear
> to me that we can change that aspect of piped loggers anyway, since it
> can break third-party code.

I have a patch in-progress somewhere which does attempt the alternative
approach, but I stalled on this exactly because of the concern for
breaking third-party loggers.  (I think I checked cronolog and found it
would just spin forever calling read() if stdin was closed)

I think it would be OK to make the behaviour change for 2.2 at least,
since the current behaviour of losing log entries during graceful
restart if using piped loggers is definitely Surprising Behaviour (tm).

But +1 on the alternative appropach in lieu of any round tuits to get
that done.  Definitely +1 on this approach for 2.0.x too.  Thanks Jeff!

> b) wouldn't it be nice to have a hook similar to child-init which
> would be run in non-MPM child processes (e.g., mod_cgid's child or
> mod_fastcgi's child or children created in various other
> non-Apache-distributed modules)

I suppose there is a better argument to start setting FD_CLOEXEC 
everywhere...

joe

Reply via email to