Merge lp:~mpontillo/maas/try-not-to-spawn-loads-of-observation-processes into lp:~maas-committers/maas/trunk
Status: | Merged |
---|---|
Approved by: | Mike Pontillo |
Approved revision: | no longer in the source branch. |
Merged at revision: | 5344 |
Proposed branch: | lp:~mpontillo/maas/try-not-to-spawn-loads-of-observation-processes |
Merge into: | lp:~maas-committers/maas/trunk |
Prerequisite: | lp:~allenap/maas/drive-bys-2016-09-06 |
Diff against target: |
469 lines (+180/-78) 2 files modified
src/provisioningserver/utils/services.py (+95/-33) src/provisioningserver/utils/tests/test_services.py (+85/-45) |
To merge this branch: | bzr merge lp:~mpontillo/maas/try-not-to-spawn-loads-of-observation-processes |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mike Pontillo (community) | Approve | ||
Gavin Panella | Pending | ||
Review via email: mp+305505@code.launchpad.net |
This proposal supersedes a proposal from 2016-09-09.
Commit message
Fix bug that caused a large number of observation processes to spawn in certain situations. (Especially when observation processes die, or interface configuration changes.)
* Add unit test for runaway process issue.
* Move responsibility for managing Deferred (used to indicate when the service has stopped) from the ProcessProtocol implementation to the ProcessProtocol
* Refactor unit tests to account for the new design.
* Fix a typo that could have caused reconfigured interfaces to fail to spawn.
Description of the change
I've been testing this end-to-end all day, and LaMont verified (on an earlier version of this branch) that the code is working much better now.
This branch should ship with the next alpha to increase reliability. Without it, we can spawn processes every minute or so and eventually use up all the resources on a MAAS rack.
All looks good. I have lots of small suggestions for simplifying the code, or to be more idiomatically Twisted, but I'll propose those as a follow-on instead of here, because this code is good to land as it is.