Merge lp:~rvb/maas/bug-lock-atexit into lp:~maas-committers/maas/trunk
Status: | Merged |
---|---|
Approved by: | Raphaël Badin |
Approved revision: | no longer in the source branch. |
Merged at revision: | 1596 |
Proposed branch: | lp:~rvb/maas/bug-lock-atexit |
Merge into: | lp:~maas-committers/maas/trunk |
Diff against target: |
56 lines (+23/-1) 2 files modified
src/maasserver/start_up.py (+4/-0) src/maasserver/tests/test_start_up.py (+19/-1) |
To merge this branch: | bzr merge lp:~rvb/maas/bug-lock-atexit |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jeroen T. Vermeulen (community) | Approve | ||
Gavin Panella (community) | Approve | ||
Review via email: mp+185430@code.launchpad.net |
Commit message
Remove the lock if the process gets killed in start_up().
Description of the change
Testing shows this fixes bug 1221059: what we suspect happens here is that, when the call to the avahi bindings errors, apache kills (with SIGTERM) the WSGI process. This causes the lock to be left on disk, which in turn prevents any other WSGI to start because start_up() blocks, waiting for the lock to be removed.
Note that this will only make MAAS cope with transient avahi errors, if an error is permanent (i.e. if the call to the avahi bindings always errors) then this won't mask the problem.
Testing show that this fix works: I've build a package with this fix and tested it.
http://
Runs [27-30] are done using the package with this fix.
Runs [31-34] are done with the daily package (i.e. without the fix)
(The tests used here are a simplified version of the integration tests, which only run up to the point where one can log into the API)
Looks good. I'm still baffled that atexit works but finally doesn't,
but data is king and I'm happy that you've figured out a way to
address this issue.
[1]
+ atexit_recorder = self.patch( start_up, 'register_atexit')
You could patch the atexit module directly. That would remove the need
for the import-as. Or you could mock the atexit name in the start_up
module.