Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Wait for machines on controller kill and destroy commands #6674
Conversation
|
ping @bz2 for peeking at this please and thank you |
|
Noice, turned out to be much simpler than I expected. LGTM, but please wait for @bz2's comments. |
bz2
suggested changes
Dec 8, 2016
Code change looks good, but I think it's time to come up with nicer spelling.
| ctx.Infof("Waiting for hosted model resources to be reclaimed") | ||
| - for ; hasUnDeadModels(modelsStatus); ctrStatus, modelsStatus = updateStatus(2 * time.Second) { | ||
| + for ; hasUnDeadModels(modelsStatus) || ctrStatus.HostedMachineCount > 0; ctrStatus, modelsStatus = updateStatus(2 * time.Second) { |
bz2
Dec 8, 2016
Contributor
With the loop getting this complicated (and sort of repeated twice), I think it warrants some refactoring.
Maybe updateStatus should return a single encapsulating object, which a (renamed) hasUnDeadModels should take and return a bool?
bz2
approved these changes
Dec 8, 2016
Thanks! I think this is much easier to follow now.
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
!!build!! |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
macgreagoir commentedDec 8, 2016
kill-controlleranddestroy-controllernow also wait on machines yetto be removed as well as the previous behaviour of waiting on models yet
to be destroyed. This fixes a bug in which machines in the controller
model were not given time to complete their removal before the
controller itself was destroyed.
Fixes lp:1642295
QA steps:
bootstrap, thenadd-machineto the controller modeldestroy-controllerand observe the destroy procedure continue until the machine in the controller model is removed, which will happen after the default model is destroyedkill-controller