> From [EMAIL PROTECTED] Mon Dec 15 03:36:49 2003
> Date: Mon, 15 Dec 2003 10:46:45 +0000 (GMT)
> From: Toby Blake <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Re: LPRng: lengthy delay between one job finishing and another one
>  starting
>
> > If you are using your own filters,  then make sure you close
> > the STDOUT/STDIN, etc., and make sure you exit.
>
> I'm almost 100% certain that the problem is *not* related to our
> filters.  As you can see below, the psif filter happily finishes at
> 15:27:59, however there is a further delay of 7 minutes while lpd is
> waiting for the subserver to exit:
>
> IF filter 'psif' filter finished at 2003-12-09-15:27:59.884 ## [EMAIL PROTECTED] 
> number=602 process=23168
> printing finished at 2003-12-09-15:27:59.884 ## [EMAIL PROTECTED] number=602 
> process=23168
> accounting at end at 2003-12-09-15:27:59.910 ## [EMAIL PROTECTED] number=602 
> process=23168
> finished '[EMAIL PROTECTED]', status 'JSUCC' at 2003-12-09-15:27:59.910 ## [EMAIL 
> PROTECTED] number=602 process=23168
> waiting for subserver to exit at 2003-12-09-15:34:58.800 ## A=<NULL> number=0 
> process=23164
> subserver pid 23168 exit status 'JSUCC' at 2003-12-09-15:34:58.800 ## A=<NULL> 
> number=0 process=23164
>
> Note that these subserver lpd processes appear in output from top as
> 'defunct' and won't be killed even by a kill -9 but are killed somehow
> after the delay above.
>
> I also only seem to see this problem when there are a lot of jobs in
> the queue - in this case, in excess of 40 on one printer and 20+ on
> another printer, both served by this server - as the queue sizes go
> down, the delay goes down too.  Can the size of the queue be affecting
> this?
>
> Toby

These processes are 'zombies' waiting for the main LPD process to
harvest (wait) for them.  The LPD code is waiting in a select
loop for either a process to exit or for a connection.

        Setup_waitpid_break();
        errno = 0;
        fd_available = select( max_socks,
            FD_SET_FIX((fd_set *))&readfds,
            FD_SET_FIX((fd_set *))0,
            FD_SET_FIX((fd_set *))0, timeout );
        err = errno;
        Setup_waitpid();

plp_signal_t sigchld_handler (int signo)
{
    signal( SIGCHLD, SIG_DFL );
    write(Lpd_request,"\n", 1);
}

void Setup_waitpid (void)
{
    signal( SIGCHLD, SIG_DFL );
}

void Setup_waitpid_break (void)
{
    (void) plp_signal_break(SIGCHLD, sigchld_handler);
}

So under load, the LPD server will probably wait in the select for 
a while.

Patrick

-----------------------------------------------------------------------------
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
The address you post from MUST be your subscription address

If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body.  For the impatient,
to subscribe to a list with name LIST,  send mail to [EMAIL PROTECTED]
with:                           | example:
subscribe LIST <mailaddr>       |  subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr>     |  unsubscribe lprng [EMAIL PROTECTED]

If you have major problems,  send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------

Reply via email to