-
Notifications
You must be signed in to change notification settings - Fork 495
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3558 from axw/lp1444912-errterminateagent-nounins…
…tall cmd/jujud/agent: rework uninstall-gating logic The fix for https://bugs.launchpad.net/juju-core/+bug/1464304 was too narrowly focused on the SIGABRT trigger, and so this commit changes how we gate uninstall. The termination worker was doing the uninstall-agent file check, but it really belongs at the top level of the machine agent, because we attempt to uninstall whenever the agent gets an ErrTerminateAgent. This can happen in various ways, such as SIGABRT, or just because the agent made an bad authorization attempt when opening the API connection. So we move the check to the top level, and undo the checking in the termination worker. For this to work and still uninstall when the machine is destroyed, we must make deeper changes: - the machiner worker must inform the agent code when it has set the machine to Dead. Immediately after the machine is set to Dead, we write out the uninstall-agent file so the ensuing ErrTerminateAgent will cause an uninstall - if the machine is Dead in state when the agent connects, we also want to write out the uninstall-agent file. This means changing worker/apicaller to not error on Dead entities, but leave that up to the caller There is a test removed from the unit agent which was really in the wrong place (it was calling worker/apicaller code directly, and asserting on its results). More importantly, this behaviour has changed; we now rely on the worker/uniter code to return ErrTerminateAgent when it encounters the Dead unit entity. Fixes https://bugs.launchpad.net/juju-core/+bug/1444912 (Review request: http://reviews.vapour.ws/r/2958/)
- Loading branch information
Showing
10 changed files
with
364 additions
and
199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.