Merge lp:~spiv/bzr/debug-flag-relock into lp:bzr
Proposed by
Andrew Bennetts
Status: | Superseded |
---|---|
Proposed branch: | lp:~spiv/bzr/debug-flag-relock |
Merge into: | lp:bzr |
Diff against target: |
230 lines 7 files modified
NEWS (+4/-0) bzrlib/branch.py (+6/-1) bzrlib/help_topics/en/debug-flags.txt (+4/-2) bzrlib/lock.py (+21/-0) bzrlib/remote.py (+6/-2) bzrlib/repofmt/pack_repo.py (+7/-0) bzrlib/repository.py (+4/-1) |
To merge this branch: | bzr merge lp:~spiv/bzr/debug-flag-relock |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Vincent Ladeuil | Needs Fixing | ||
Review via email: mp+12968@code.launchpad.net |
This proposal has been superseded by a proposal from 2009-10-07.
To post a comment you must log in.
This is an idea I had while looking at bug 389413. It adds a -Drelock debug flag to make noise about cases where we probably should take more care to just hold one lock rather than locking/ unlocking/ locking- again.
Here's some sample output:
$ ./bzr diff -c 4148 . -Drelock > /dev/null 'file:/ //home/ andrew/ warthogs/ bzr/debug- flag-relock/ ') was read locked again ository( 'file:/ //home/ andrew/ warthogs/ bzr/.bzr/ repository/ ') was read locked again ository( 'file:/ //home/ andrew/ warthogs/ bzr/.bzr/ repository/ ') was read locked again ository( 'file:/ //home/ andrew/ warthogs/ bzr/.bzr/ repository/ ') was read locked again 'file:/ //home/ andrew/ warthogs/ bzr/debug- flag-relock/ ') was read locked again ository( 'file:/ //home/ andrew/ warthogs/ bzr/.bzr/ repository/ ') was read locked again 'file:/ //home/ andrew/ warthogs/ bzr/debug- flag-relock/ ') was read locked again ository( 'file:/ //home/ andrew/ warthogs/ bzr/.bzr/ repository/ ') was read locked again ository( 'file:/ //home/ andrew/ warthogs/ bzr/.bzr/ repository/ ') was read locked again ository( 'file:/ //home/ andrew/ warthogs/ bzr/.bzr/ repository/ ') was read locked again 'file:/ //home/ andrew/ warthogs/ bzr/debug- flag-relock/ ') was read locked again
BzrBranch7(
CHKInventoryRep
CHKInventoryRep
CHKInventoryRep
BzrBranch7(
CHKInventoryRep
BzrBranch7(
CHKInventoryRep
CHKInventoryRep
CHKInventoryRep
BzrBranch7(
Hopefully that gives some idea of how much we can improve :)
Possibly we should have a more generic hook point for lock/unlock operations so that tests can assert "object X is only locked once", similar to the existing HPSS effort tests... but this seems cheap and useful. (The existing hook points for lockdir lock_acquired/ lock_released would only catch lock_write, not lock_read, so they aren't sufficient for this case.)