Rev 2559: Remove unnecessary confirmation after acquiring LockDir in http://sourcefrog.net/bzr/dlock

John Arbash Meinel john at arbash-meinel.com
Wed Jun 27 15:30:59 BST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Pool wrote:
> At http://sourcefrog.net/bzr/dlock
> 
> ------------------------------------------------------------
> revno: 2559
> revision-id: mbp at sourcefrog.net-20070627081353-f3402usvh4zlcs7q
> parent: mbp at sourcefrog.net-20070627081010-k0j4wgcyjjfabbe9
> committer: Martin Pool <mbp at sourcefrog.net>
> branch nick: dlock
> timestamp: Wed 2007-06-27 18:13:53 +1000
> message:
>   Remove unnecessary confirmation after acquiring LockDir
> modified:
>   bzrlib/lockdir.py              lockdir.py-20060220222025-98258adf27fbdda3
> === modified file 'bzrlib/lockdir.py'
> --- a/bzrlib/lockdir.py	2007-06-27 08:10:10 +0000
> +++ b/bzrlib/lockdir.py	2007-06-27 08:13:53 +0000
> @@ -223,7 +223,10 @@
>  
>              self.transport.rename(tmpname, self._held_dir)
>              self._lock_held = True
> -            self.confirm()
> +            # we used to do self.confirm() at this point, but it's really
> +            # unnecessary, we have no substantial chance of having it broken
> +            # just as it's acquired, and we believe that this lock design is
> +            # safe on all platforms.
>              # FIXME: we should remove the pending lock if we fail, 
>              # https://bugs.launchpad.net/bzr/+bug/109169
>          except errors.PermissionDenied:
> 
> 

This is not 100% true.

It was this 'self.confirm()' check that discovered that Launchpad's SFTP server
was not properly excluding directory renames.

So without this 'self.confirm()' we would have never detected the (probably
corrupted) data when 2 people pushed at the same time.

I know it is a bit of overhead, but since we have at least 1 case of our
assumptions being violated, I'd rather not wait for another one which is
accompanied by data corruption.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGgnSiJdeBCYSNAAMRAl7rAJ9AlCr+Ptuzhc7X/omruINm6ftisQCfZghR
XcmHMug0RJMnqpMADyvNmUw=
=GWGH
-----END PGP SIGNATURE-----



More information about the bazaar mailing list