Merge lp:~flacoste/launchpad/bug-688503 into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Gary Poster |
Approved revision: | no longer in the source branch. |
Merged at revision: | 12104 |
Proposed branch: | lp:~flacoste/launchpad/bug-688503 |
Merge into: | lp:launchpad |
Diff against target: |
293 lines (+197/-9) 8 files modified
lib/canonical/launchpad/webapp/configure.zcml (+11/-0) lib/canonical/launchpad/webapp/dbpolicy.py (+2/-2) lib/canonical/launchpad/webapp/haproxy.py (+63/-0) lib/canonical/launchpad/webapp/publication.py (+8/-5) lib/canonical/launchpad/webapp/sighup.py (+26/-0) lib/canonical/launchpad/webapp/tests/test_haproxy.py (+49/-0) lib/canonical/launchpad/webapp/tests/test_sighup.py (+36/-0) utilities/page-performance-report.ini (+2/-2) |
To merge this branch: | bzr merge lp:~flacoste/launchpad/bug-688503 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gary Poster (community) | Approve | ||
Review via email: mp+44102@code.launchpad.net |
Commit message
[r=gary][ui=none][bug=688503] Add a /+haproxy monitoring URL that can controlled through SIGHUP. That allows an easy way to take app servers out of rotation for graceful shutdown and restart.
Description of the change
Hi,
(Looks like I'm missing a plugin...)
This implements the LOSA request described in bug 688503. It adds a view at
/+haproxy that return status 200 or 500 based on a global flag. That flag is
controlled through the SIGHUP signal (suggested by elmo).
This URL will be used as the probe URL in HAProxy. Normally, it returns 200
and this tells HAProxy that the app server is functioning normally. When that
requests fails or returns 500, HAProxy will stop sending requests to it.
This will allow to restart app servers without interrupting user requests, as
LOSA will send the HUP signal which will stop HAProxy from dispatching
requests to it. The deployment script will then monitor the HAProxy status
board until all existing requests dispatched are completed. The app server
will then be able to be restarted.
Previously the URL used was /+opstats and we have some exceptional rules for
that view. I've implemented the same exceptions for this as it should also not
talk to the DB and be excluded from the PPR reports.
Tests can be run with test -vvm canonical.
and canonical.
QA can be done by sedning the HUP signal to the app server, looking at the log
and visiting the /+haproxy url.
Let me know if you have any questions.
Looks good, thank you.
in the PPR, you maybe could change "All launchpad except opstats" to "All launchpad except haproxy pages". I don't think it really matters, but if you want to.