Subject: Re: Bug in gzip.c buffering, and two feature requests

From: Paul Eggert <[email-masked]>
Date: Sat, 14 Sep 2013 23:13:22 -0500

Your gzip feature requests sound reasonable, except for this one:

On 09/14/2013 07:57 PM, Martin Langhoff wrote:

> Bug: gzip.c discards its buffers when it gets SIGTERM, with no
> effort made to flush them to disk.

That's the normal behavior of utilites when they get SIGTERM; they
exit right away with minimal fuss, and they typically do not attempt
to flush output buffers.

> Logging via gzip adds buffering, when apache is stopped (or
> restarted, usually daily to rotate logs), apache sends SIGTERM
> before it closes the fh;

That seems wrong.  Apache should close the file handle, and let gzip
finish up cleanly.  Maybe Apache should kill gzip if gzip doesn't exit
reasonably soon after the file handle is closed, but it'd be misguided
for Apache to kill off gzip first, before closing the file handle.  If
this is really Apache's behavior, perhaps you should file an Apache
bug report.