Merge lp:~axwalk/juju-core/lp1176740-destroy-unit-short-circuit into lp:~go-bot/juju-core/trunk
Proposed by
Andrew Wilkins
Status: | Work in progress |
---|---|
Proposed branch: | lp:~axwalk/juju-core/lp1176740-destroy-unit-short-circuit |
Merge into: | lp:~go-bot/juju-core/trunk |
Diff against target: |
65 lines (+21/-2) 2 files modified
worker/uniter/modes.go (+5/-0) worker/uniter/uniter_test.go (+16/-2) |
To merge this branch: | bzr merge lp:~axwalk/juju-core/lp1176740-destroy-unit-short-circuit |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email:
|
Description of the change
destroy-unit: respond to Dying in hook-failure
If the user invokes destroy-unit while a unit
is in a hook-error state, the uniter should
respond to the dying state as if it were in
steady state.
If the unit hasn't started yet (e.g. the install
hook failed), then the uniter should short-circuit
the termination handling.
To post a comment you must log in.
Unmerged revisions
- 1605. By Andrew Wilkins
-
destroy-unit: respond to dying state in hook-failure
If the user invokes destroy-unit while a unit
is in a hook-error state, the uniter should
respond to the dying state as if it were in
steady state.If the unit hasn't started yet (e.g. the install
hook failed), then the uniter should short-circuit
the termination handling.
Reviewers: mp+178694_ code.launchpad. net,
Message:
Please take a look.
Description:
destroy-unit: respond to Dying in hook-failure
If the user invokes destroy-unit while a unit
is in a hook-error state, the uniter should
respond to the dying state as if it were in
steady state.
If the unit hasn't started yet (e.g. the install
hook failed), then the uniter should short-circuit
the termination handling.
https:/ /code.launchpad .net/~axwalk/ juju-core/ lp1176740- destroy- unit-short- circuit/ +merge/ 178694
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/12517043/
Affected files: uniter/ modes.go uniter/ uniter_ test.go
A [revision details]
M worker/
M worker/
Index: [revision details] 20130806053414- fbcxuyvncbfz3m8 n
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-
+New revision: <email address hidden>
Index: worker/ uniter/ modes.go uniter/ modes.go' uniter/ modes.go 2013-08-02 12:37:43 +0000 uniter/ modes.go 2013-08-06 09:06:11 +0000 SubordinateName s() { IsNotFoundError (err) { oop(u) vents() : etryHooks:
=== modified file 'worker/
--- worker/
+++ worker/
@@ -287,6 +287,9 @@
if err := u.unit.Refresh(); err != nil {
return nil, err
}
+ if !u.s.Started {
+ return ModeTerminating, nil
+ }
for _, name := range u.unit.
if sub, err := u.st.Unit(name); errors.
continue
@@ -341,6 +344,8 @@
select {
case <-u.tomb.Dying():
return nil, tomb.ErrDying
+ case <-u.f.UnitDying():
+ return modeAbideDyingL
case rm := <-u.f.ResolvedE
switch rm {
case state.ResolvedR
Index: worker/ uniter/ uniter_ test.go uniter/ uniter_ test.go' uniter/ uniter_ test.go 2013-08-02 12:37:43 +0000 uniter/ uniter_ test.go 2013-08-06 09:06:11 +0000 r{"start" }, ng{}, "start" }, r{state. ResolvedRetryHo oks}, StatusStarted} , "start" , "config-changed", "stop"}, ead{}, "start" }, r{"start" }, ng{}, "start" }, r{state. ResolvedRetryHo oks}, StatusStarted} , "start" , "config-changed", "stop"}, ead{}, "start" }, r{"start" },
=== modified file 'worker/
--- worker/
+++ worker/
@@ -490,22 +490,36 @@
), ut(
"hook error service dying",
startupErro
- serviceDying,
verifyWaiti
fixHook{
resolveErro
+ waitUnit{status: params.
+ serviceDying,
waitHooks{
waitUniterD
), ut(
+ "hook error service dying (not started)",
+ startupError{
+ serviceDying,
+ waitHooks{},
+ waitUniterDead{},
+ ), ut(
"hook error unit dying",
startupErro
- unitDying,
verifyWaiti
fixHook{
resolveErro
+ waitUnit{status: params.
+ unitDying,
waitHooks{
waitUniterD
), ut(
+ "hook error unit dying (not started)",
+ startupError{
+ unitDying,
+ waitHooks{},
+ waitUniterDead{},
+ ), ut(
"hook error unit dead",
startupErro
unitDead,