On 19 November 2014 at 19:59, William Reade <[email protected]> wrote: > On Tue, Nov 18, 2014 at 9:37 AM, Stuart Bishop > <[email protected]> wrote: >> Ok. If there is a goal state, and I am able to wait until the goal >> state is the actual state, then my needs (and amulet and juju-deployer >> needs) will be met. It does seem a rather lengthy and long winded way >> of getting there though. The question I have always needed juju to >> answer is 'are there any hooks running or are there any hooks queued >> to run?'. I've always assumed that juju must already know this (or it >> would be unable to function), but refuses to communicate this single >> bit of information in any way. > > Juju as a system actually doesn't know this. Unit idleness is known > only by the unit agents themselves, and only implicitly at that -- if > we're blocking in a particular select clause then we're (probably!) > idle, and that's it. I agree that exposing idleness would be good, and > I'm doing some of the preliminary work necessary right now, but it's > not my current focus: it's just a happy side-effect of what needs to > be done for leader election.
Ok. I was thinking of a central system tracking the unit states and firing hooks, but it seems the units are much more independent, tracking their own state and making their own decisions. >> That would work too. If all units are in idle state, then the system >> has reached a steady state and my question answered. > > Sort of. It's steady for now, but will not necessarily still be steady > by the time you're reacted to it -- even if you're the only > administrator, imagine a cron job that uses juju-run and triggers a > wave of relation traffic across the system. Your example is actually a steady state in my mind, in much the same way a biological system may be in a steady state despite having a heartbeat. But yes, you can construct some pathological cases where my heuristic is not good enough to detect when the system has reached an equilibrium. I am perfectly fine with reporting that the system *was* in a steady state rather than *is* in a steady state. If your system is chaotic enough where the difference matters, I think you are better off fixing it rather than forging ahead attempting to reliably test and deploy a chaotic system. -- Stuart Bishop <[email protected]> -- Juju-dev mailing list [email protected] Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/juju-dev
