On Jul 24, 2009, at 10:02 AM, Steven Jenkins wrote: > > Luke Kanies wrote: >> On Jul 24, 2009, at 7:02 AM, Mark Plaksin wrote: >> >>> Luke Kanies <[email protected]> writes: >>> >>>> Hi all, >>>> >>>> I'm trying to figure out which signal should do what with ticket >>>> #2239, or if we should even keep the existing behaviour. >>>> >>>> If you send a signal to puppetd when it's in the middle of a >>>> transaction, what behaviour do you expect? >>> There's a similar question about puppetmasterd. As-is it *appears* >>> that >>> puppetmasterd will die in the middle of a transaction. For example, >>> if >>> our init script sends SIGTERM to a puppetmasterd running behind >>> Mongrel >>> then in-flight transactions seem to die. I say "seem" because I'm >>> not >>> positive :) >>> >>> When we were using Mongrel our init script's 'restart' function >>> stopped >>> and started our puppetmasterds one at a time. In theory that meant >>> that >>> no client would notice but in practice they always did. >>> >>> It's possible that mod_proxy was actually to blame but I figured I'd >>> throw this out to you experts :) >> >> This is a harder problem, I think, because it means tracking whether >> we're mid-connection, not accepting new connections when we get a >> signal, and then exiting when our connection list is empty. >> >> This all has to be thread-safe, too, just to make it more fun. >> >> I don't know how other systems solve this problem, but if anyone >> does, >> I'd love to hear about it. >> > > I suggest that TERM, INT, and KILL all kill with prejudice. If > someone needs a > 'graceful' shutdown, that USR1 be used for that. You could get more > complex, e.g.: > > TERM, INT, KILL mean 'exit now' > USR1 means 'exit after current transaction' (the current behavior > for INT and TERM) > USR2 means 'exit after current resource, and don't do any further > work in the > current transaction, even if it leaves state somewhat > indeterminate' (this would > be new behavior).
I think the default restart behaviour should not default to leaving people in a bad state. At the least, I think we should finish the current resource, and I almost think we should do any service restarts that are necessary, although that will be quite a bit harder until the event system is revamped. -- Nothing is impossible for the man who doesn't have to do it himself. -- A. H. Weiler --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en -~----------~----~----~----~------~----~------~--~---
