Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Make all model watcher more robust #7272
Conversation
| @@ -119,6 +119,11 @@ type backingModel modelDoc | ||
| func (e *backingModel) updated(st *State, store *multiwatcherStore, id string) error { | ||
| cfg, err := st.ModelConfig() | ||
| + // Treat a not found error here as if the model has been removed. | ||
| + // This will be the case if the model has been marked dead, pending cleanup. | ||
| + if errors.IsNotFound(err) && e.Life == Dead { |
mjs
Apr 24, 2017
Contributor
make a helper for this? Then the comment doesn't need to be repeated each time either. Something like ifNotFoundAndModelDead(err, e)
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
jujubot
merged commit a913949
into
juju:develop
Apr 24, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
wallyworld commentedApr 24, 2017
Description of change
Dead models might, in some circumstances, not have settings or other dependent documents still in the state database. The all model watcher handles this by treating it as if the model is removed from the backing state.
QA steps
Hard to validate exact fix as dead models without settings required db pokery, so regression test.
Bug reference
https://bugs.launchpad.net/juju/+bug/1685321