Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Fixed lp:1635464: infinite recursion in worker/peergroper #6495
Conversation
frankban
approved these changes
Oct 25, 2016
Looks good, and the method is defined (even if State is embedded) for testing/stubbing purposes I guess. Thank you!
perrito666
reviewed
Oct 25, 2016
I am worried that this change touches no tests, even thiugh it is impractical to test for coding errors it is mote worthy that there seems to be no test exercising this path in a way that triggers the previous error.
|
$$fixes-1635464$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
$$again$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
dimitern commentedOct 25, 2016
When validating the "mongo" space name (common among all controllers),
the way stateShim.Space() was implemented in worker/peergrouper/shim.go
caused infinite recursion when called. This fixes http://pad.lv/1635464.
While I couldn't reproduce this normally, it's easy to trigger the case
when state.ControllerInfo.MongoSpaceState is "valid" by modifying the
mongo controllers collection directly.
QA steps (if you do those same steps without the fix, the bug happens):
verify no matches are found initially
juju:PRIMARY> use juju;
juju:PRIMARY> db.controllers.update({_id:"e"}, {"$set": {"mongo-space-name": "space-0", "mongo-space-state": "valid"}})
output: WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
juju:PRIMARY> exit;verify the peergrouper picked up the change (>1 matches expected)
verify the bug does not occur after the changes