Merge lp:~rockstar/tarmac/lock-issues into lp:tarmac
Proposed by
Paul Hummer
Status: | Merged |
---|---|
Approved by: | Paul Hummer |
Approved revision: | 399 |
Merged at revision: | 406 |
Proposed branch: | lp:~rockstar/tarmac/lock-issues |
Merge into: | lp:tarmac |
Diff against target: |
104 lines (+44/-37) 1 file modified
tarmac/branch.py (+44/-37) |
To merge this branch: | bzr merge lp:~rockstar/tarmac/lock-issues |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
dobey | Approve | ||
Review via email: mp+95287@code.launchpad.net |
Commit message
Wrap branch and tree locks in a finally to guarantee the .unlock will be called
Description of the change
This solution is *pretty* naive, but I thought I'd give it a shot (and it's a good idea anyway). I wrapped all the .lock() calls in a try: block with the unlock in a finally: block. This may or may not fix the segfault problem in our current tarmac, but it's worth a shot, and might be an easy win, rather than having to set up some really complicated test environment to reproduce. *shrug*
To post a comment you must log in.
I don't think this code is where the problem is with the tarmac we have set up for ubuntuone. It is a fork with a patch I was working on, to add more extensive locking to deal with the multiple tarmac instances getting run, cases. I asked sidnei to link me to a couple logs where I could more explicitly where it was failing. We really need to properly fix the locking in tarmac though, as calling bzr_branch. lock_read( ) and such is incorrect. bzrlib should be holding the branch locked the entire time we're using it, but the way we're using bzr branches sort of breaks the way that works.
I'm going to vote Disapprove on this branch, because I'm like 10^1000% sure that the issue we're seeing, is not in these calls. Rather it's almost certainly happening in the command.py which is patched in the running instance, to keep the branch locked the entire time tarmac is dealing with that specific branch, so that other instances, or people, don't step on its feet while tests are running for a branch or something. We can discuss more on IRC tomorrow.