[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [leafnode-list] SIGCHLD, read EOF, and checking EINTR
On Tue, 5 Feb 2002, Matthias Andree wrote:
> I'd rather go figure where this can bite, I can only imagine nntpd
> suffering from that problem,
That makes some sense. I grepped around the code for fork, raise and kill
to try to figure out what was going on, and haven't fully satisfied myself
that I do see what is going on. All I know is that without the patch,
leafnode drops the connection with my client after fetchnews is run. The
patch fixes that, and seems to do no appearent harm otherwise. Also,
while I don't understand where the signal is coming from, I do understand
the patch, and it seems like a very safe error condition check.
> and I could also imagine setting SIGCHLD to ignore to let the kernel
> reap nntpd's children automatically without wait. After all, nntpd does
> not really need to fork at all.
Even if you can eliminate all the forks, it still makes sense to check for
errno == EINTR on EOF in getline, since that guards against future
additions of code that cause signals to be sent. It's just checking for
normal error conditions. Generally good practice.
I'm wondering if on some systems kill(pid, 0) (from lockfile.c) is not
behaving as documented. Again, the patch I provided would protect against
such buggy systems.
Anyway, thanks for considering this and for maintaining and developing
Jeffrey Goldberg http://www.goldmark.org/jeff/
Relativism is the triumph of authority over truth, convention over justice
leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx -- mailing list for leafnode
To unsubscribe, send mail with "unsubscribe" in the subject to the list