improve state caching
Bug #1031546 reported by
Dave Cheney
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
juju-core |
Invalid
|
High
|
Roger Peppe |
Bug Description
As discussed during the July sprint, improving the caching of state objects, thereby reducing the number of error paths to be checked would be highly beneficial.
This issue is a placeholder for that discussion.
Changed in juju-core: | |
milestone: | none → 1.2 |
importance: | Undecided → High |
Changed in juju-core: | |
assignee: | nobody → Roger Peppe (rogpeppe) |
Changed in juju-core: | |
status: | Confirmed → Invalid |
To post a comment you must log in.
The discussion, IIRC, evolved towards something resembling this:
- Have Refresh methods on all resources that may change
- Take the error result out of accessor methods that lookup cached information
- Have setter methods that mutate the specific field, and change the cached value
- Optionally update the cached state on mutations (even more if we're forced to reload it)
- Change watchers so they always return a new value rather than a cached one
That last step depends on lifecycle to handle removals properly.