Michael Carmack writes:

======================================================================
   Meanwhile, there is more output from the"courierfilter start" trace
======================================================================


[EMAIL PROTECTED] strace -vfp 1565

Process 1565 attached - interrupt to quit
rt_sigsuspend([])                       = ? ERESTARTNOHAND (To be restarted)
--- SIGTERM (Terminated) @ 0 (0) ---
rt_sigreturn(0xf)                       = -1 EINTR (Interrupted system call)
writev(2, [{"INFO: Stopping perlfilter", 25}, {"\n", 1}], 2) = 26
close(8)                                = 0

Keep this close(8) in mind.  That's one end of a pipe.

================================================================
   Now I kill the root perlfilter and they all die
================================================================

The root perlfilter would be waiting on the other end of the pipe:

        signal(SIGCHLD, reap_children);
        lf_init_completed(listen_sock);

        while (read(0, &buffer, 1) != 0)
        {
                ;
        }
        wait_restore();

reap_children() restarts any child process that terminates. What should be happening is that the root parent process waits until the pipe is closed, then it resets SIGCHLD (in wait_restore) to the default reaper. All existing child processes are also listening on stdin, and when it's closed they terminate, then get reaped by the default SIGCHLD handler.

What must be happening is for some reason the root perlfilter never wakes up, and calls wait_restore() to reset SIGCHLD. When the child processes die, they just get respawned by reap_children(). The new process starts waiting for stdin to close, it already is, so it dies immediately, and the cycle repeats itself.

Your root perfilter must not be waking up, for some reason, when the pipe gets closed, it never resets the signal handler, so everything else keeps dying and respawning. Then when you strace it, it belatedly wakes up and finishes the job. That must be what's happening.

Now, try attaching strace to the root perlfilter after you start everything, but before you run courierfilter stop.


Attachment: pgpoVnJCFvoa3.pgp
Description: PGP signature

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
courier-users mailing list
courier-users@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to