Merge lp:~thumper/juju-core/fix-local-destroy into lp:~go-bot/juju-core/trunk
Proposed by
Tim Penhey
Status: | Merged |
---|---|
Approved by: | Tim Penhey |
Approved revision: | no longer in the source branch. |
Merged at revision: | 2625 |
Proposed branch: | lp:~thumper/juju-core/fix-local-destroy |
Merge into: | lp:~go-bot/juju-core/trunk |
Diff against target: |
18 lines (+8/-0) 1 file modified
provider/local/environ.go (+8/-0) |
To merge this branch: | bzr merge lp:~thumper/juju-core/fix-local-destroy |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+215601@code.launchpad.net |
Commit message
Fix intermittent destroy error.
In order to manage the intermittent error that is returned
by os.RemoveAll if the directory is removed by another process
while it is trying, we double check before returning an error.
Description of the change
Fix intermittent destroy error.
In order to manage the intermittent error that is returned
by os.RemoveAll if the directory is removed by another process
while it is trying, we double check before returning an error.
To post a comment you must log in.
Reviewers: mp+215601_ code.launchpad. net,
Message:
Please take a look.
Description:
Fix intermittent destroy error.
In order to manage the intermittent error that is returned
by os.RemoveAll if the directory is removed by another process
while it is trying, we double check before returning an error.
https:/ /code.launchpad .net/~thumper/ juju-core/ fix-local- destroy/ +merge/ 215601
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/87500044/
Affected files (+10, -0 lines): local/environ. go
A [revision details]
M provider/
Index: [revision details] 20140413170514- ii8w6q2fht3eiiz i
=== 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: provider/ local/environ. go local/environ. go' local/environ. go 2014-04-09 23:13:50 +0000 local/environ. go 2014-04-14 06:47:17 +0000
=== modified file 'provider/
--- provider/
+++ provider/
@@ -453,6 +453,14 @@
// Finally, remove the data-dir. env.config. rootDir( )); err != nil /code.google. com/p/go/ issues/ detail? id=7776) the env.config. rootDir( )); os.IsNotExist( statErr) {
if err := os.RemoveAll(
&& !os.IsNotExist(err) {
+ // Before we return the error, just check to see if the directory is
+ // there. There is a race condition with the agent with the removing
+ // of the directory, and due to a bug
+ // (https:/
+ // os.IsNotExist error isn't always returned.
+ if _, statErr := os.Stat(
+ return nil
+ }
return err
}
return nil