Commit Graph

9 Commits

Author SHA1 Message Date
James Shubin
06635dfa75 Rename GetRes() which is not descriptive, to Kind()
This used to be GetType(), but since now things are "resources", we want
to know what "kind" they are, since asking what "type" they are is
confusing, and makes less logical sense than "Kind".
2016-02-23 00:24:43 -05:00
James Shubin
58f41eddd9 Change API from StateOK/Apply to CheckApply()
This simplifies the API, and reduces code duplication for most
resources. It became obvious when writing the pkg resource, that the two
operations should really be one. Hopefully this will last! Comments
welcome.
2016-02-21 22:07:49 -05:00
James Shubin
3a85384377 Rename type to resource (res) and service to svc
Naming the resources "type" was a stupid mistake, and is a huge source
of confusion when also talking about real types. Fix this before it gets
out of hand.
2016-02-21 15:51:52 -05:00
James Shubin
8308680a50 Make sure to unpause all elements when resuming
The indegree code added a regression because elements with an indegree
would not be unpaused! This is now corrected. Time to add more tests :)
2016-01-19 22:01:51 -05:00
James Shubin
6e9439f4e3 Avoid panic's when referencing non-existing objects
No idea why wrapping the cmd in a function avoids a panic. Probably
something about the gc...
2016-01-15 00:03:22 -05:00
James Shubin
935805aeda Add state caching for most types
This adds state caching to avoid repeated execution when not necessary.
2016-01-14 23:17:26 -05:00
James Shubin
4c6647d807 Fixup state related items
* Fixup graph state readability
* Rename original SetState() to SetConvergedState() and friends...
* Add type state management for proper BackPoke() commands...
* Add better DEBUG logging

This is an important optimization that prevents running a BackPoke on a
parent which is in the process of running and will most certainly poke
the caller back in a moment. This avoids unnecessary roundtrips.
Unfortunately, there are still other algorithms required so that races
can't cause the graph to run for longer than necessary.
2016-01-12 04:57:05 -05:00
James Shubin
c57946e29b Fix dependency issue
* Fix Process() object calling
* Add PokeParent() to poke upwards
* Break linear exec chains :(

This was the issue where in a graph f1 -> f2, if you were to rm f2 &&
cat f2, then f2 would not come back because we didn't poke upwards to
refresh the timestamp. Unfortunately this adds another bug which we
solve in a later patch.
2016-01-12 04:20:47 -05:00
James Shubin
ea7fd76f93 Add exec type and fix up a few other things
* Add exec type
* Switch erroneous use of fmt to log instead
* Check for edge existence for safety before using
* Avoid recalling etcd channel maker
* Clean up logging output
2016-01-09 21:50:21 -05:00