Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Migration precheck for pending resources #6695
Conversation
mjs
added some commits
Dec 12, 2016
| - return &precheckShim{st}, nil | ||
| + rSt, err := st.Resources() | ||
| + if err != nil { | ||
| + st.Close() |
anastasiamac
Dec 12, 2016
Member
So we close state if we encounter an error here... Where do we close it if we succeed? I have not seen any close calls.. but may be I just don't have eagle eyes :)
mjs
Dec 13, 2016
Contributor
It's up to the caller to call Close on the returned PrecheckBackendCloser. This ends up calling Close on the embedded State.
mjs
Dec 13, 2016
Contributor
The specific Close call is here: https://github.com/juju/juju/blob/develop/migration/precheck.go#L116
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
mjs commentedDec 12, 2016
Don't allow a migration to proceed if a resource is pending. A resource is pending if it is in the process of being added or downloaded (i.e. immediately after deploy or is being downloaded). The pending state is typically short-lived.
QA
It is difficult to intentionally hit the pending state itself so a migration with 2 resource using applications was done to ensure there hasn't been a regression.