Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

worker/undertaker: don't ignore all errors #7761

Merged
merged 1 commit into from Aug 18, 2017

Conversation

axw
Copy link
Contributor

@axw axw commented Aug 18, 2017

Description of change

The undertaker was ignoring all errors when attempting
to transition a Dying model to Dead. This is wrong; we
should only ignore a couple of specific errors relating
to the contents of the model. After those errors are
received, we'll retry. Other errors should cause the
worker to restart.

QA steps

Smoke test: bootstrap, add-machine, destroy-controller --destroy-all-models.

Documentation changes

None.

Bug reference

Possibly fixes https://bugs.launchpad.net/juju/+bug/1695894

// transitions the model to Dead.
//
// If the model is non-empty because it is the controller model and still
// contains hosted models, an error satisfying IsHasHostedModelsError wll
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing vowel in "will"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

// Error is part of the error interface.
func (e modelNotEmptyError) Error() string {
msg := "model not empty, found "
plural := func(n int, thing string) string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice usability consideration :D

if model.UUID() != st.ModelUUID() && model.Life() != Dead {
return nil, errors.Errorf("one or more hosted models are not yet dead")
}
if n := len(models) - 1; n > 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AllModels() call above will return even those models that are already Dead. Do we want them to be part of this count?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, per the comment I added: we shouldn't be able to mark the controller model as Dead until all hosted models are removed

The undertaker was ignoring all errors when attempting
to transition a Dying model to Dead. This is wrong; we
should only ignore a couple of specific errors relating
to the contents of the model. After those errors are
received, we'll retry. Other errors should cause the
worker to restart.

Possibly fixes https://bugs.launchpad.net/juju/+bug/1695894
@axw axw force-pushed the lp1695894-undertaker-dont-ignore-errors branch from ebec1cf to bf0de30 Compare August 18, 2017 08:17
@axw
Copy link
Contributor Author

axw commented Aug 18, 2017

$$merge$$

@jujubot
Copy link
Collaborator

jujubot commented Aug 18, 2017

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

@jujubot jujubot merged commit ba3cc68 into juju:2.2 Aug 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants