Merge ~cjwatson/launchpad:charm-appserver-rolling-restart into launchpad:master
Status: | Merged |
---|---|
Approved by: | Colin Watson |
Approved revision: | 54cf70650c8acf0b98083a95ea597754688f6a0a |
Merge reported by: | Otto Co-Pilot |
Merged at revision: | not available |
Proposed branch: | ~cjwatson/launchpad:charm-appserver-rolling-restart |
Merge into: | launchpad:master |
Diff against target: |
144 lines (+31/-16) 5 files modified
charm/launchpad-appserver/charmcraft.yaml (+13/-0) charm/launchpad-appserver/layer.yaml (+1/-0) charm/launchpad-appserver/reactive/launchpad-appserver.py (+14/-16) charm/launchpad-appserver/templates/gunicorn.conf.py.j2 (+2/-0) charm/launchpad-appserver/templates/launchpad.service.j2 (+1/-0) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jürgen Gmach | Approve | ||
Review via email: mp+440349@code.launchpad.net |
Commit message
charm: Use rolling restart for launchpad-appserver
Description of the change
As long as we have more than one appserver unit, this ensures that the application remains responsive during upgrades, using the coordinator layer to deal with communication between units.
With gunicorn >= 20.0, waiting for the application to be responsive on each unit turns out to be a matter of setting `preload_app = True` (which causes the application to be loaded before the arbiter signals readiness, and also saves a fair amount of memory) and using `Type=notify` in the systemd service. I dropped the old soft-restart mechanism when only `*-lazr.conf` files are changed, since it doesn't quite work with application preloading and it wasn't all that much of a win anyway.