Re: logd vs. Polygraph

From: Robert Collins <robert.collins@dont-contact.us>
Date: 22 Aug 2001 19:30:09 +1000

On 22 Aug 2001 09:50:31 +0200, Henrik Nordstrom wrote:
> Robert Collins wrote:
>
> > Ouch. I wonder if squid is swallowing them itself (it has to keep the
> > log pipe open to replace the log helper seamlessly.) I need to look into
> > the select/poll stuff in more detail - unless Henrik or Adrian have any
> > insight. (We open the fds using pipe(), then don't do anything with them
> > other than pass them to the log helper. One of the ends gets marked as
> > ipc.)
>
> Only if you have installed a read select handler for the read fd, and are
> actually reading stuff from there.

Nope, we don't do that.

> My guess is that the log pipe is made non-blocking. A simple test is to
> "killall -STOP logd" and make sure Squid hangs as soon as the pipe buffer is
> full.

I take it SIGSTOP stops a process getting any more scheduler time,
pausing it?

I call
    lf->logfd = lf->ipccomm.pwfd;
    commUnsetNonBlocking(lf->logfd);
where lf->logfd is the fd that logfileWrite calls will use to send data
to the log. That should set it NonBlocking yes?

I've added an assert to the write function, to die if bytes_read
increases on the logd's stdin fd. I can't commit that until sourceforge
come back up though.

A related question: should we flush() the pipe/socket before we kill the
old helper? (If we don't, when we reuse the pipe/socket, I think we
could collide with in-pipe/socket data?).

Rob

> --
> Henrik
>
Received on Wed Aug 22 2001 - 03:30:00 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:15 MST