[SSSD] [PATCH] Wait for all children to exit

Sumit Bose sbose at redhat.com
Wed Nov 17 13:02:06 UTC 2010


On Wed, Nov 17, 2010 at 10:15:25AM +0100, Sumit Bose wrote:
> On Thu, Nov 11, 2010 at 09:05:57AM -0500, Stephen Gallagher wrote:

...

> > +    /* Kill all of our known children manually */
> > +    DLIST_FOR_EACH(svc, mt_ctx->svc_list) {
> > +        if (svc->pid == 0) {
> > +            /* The local provider has no PID */
> > +            continue;
> > +        }
> > +
> > +        DEBUG(1, ("Terminating [%s]\n", svc->name));
> > +        kill(svc->pid, SIGTERM);
> 
> I would suggest to first send SIGTERM to all children and then wait for
> them to finish.
> 
> > +
> > +        do {
> > +            errno = 0;
> > +            pid = waitpid(svc->pid, &status, 0);
> 
> If the child is in a bad state we might wait here forever. Maybe using
> WNOHANG and some timeout before sending a SIGKILL would be more
> reliable?

I would like to withdraw this comment. There are chances that a SIGKILL
too early might corrupt the cache. This is a more severe issue than
a long or stuck shutdown of sssd.

bye,
Sumit




More information about the sssd-devel mailing list