RFC: dirstate & locks

John Arbash Meinel john at arbash-meinel.com
Wed Aug 6 14:02:00 BST 2008


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

Robert Collins wrote:
| On Wed, 2008-08-06 at 16:03 +1000, Martin Pool wrote:
|
|
|> So without tracing all the way through this: getting rid of the need
|> for an OS lock would be pretty high on my list; it is arguably the
|> root cause of half a dozen bugs.   (Arguable because there may be
|> other ways to fix them.)  In this scheme it seems like a regular
|> lockdir would be enough.
|
| We still need an OSlock I think in this scheme, that or prohibit 'st
| updates sha1 cached values'.
|
| Other schemes - like a journal of updates - can provide safe
|
multi-writers-without-a-dirlock-being-acquired-and-safe-bisection-in-readers.
|
| But they are more complex and I'm looking at cheap fixes in the first
| instance.
|
| -Rob

Well, as we don't actually bisect in any reader, I certainly feel we
paid the cost of an OS lock, without seeing any benefit.

I think at the moment, we suffer a bit because we hold the locks for too
long. We hold a write lock when we are *about* to change things (such as
when we start a commit, which is held while we are waiting for user
input from their text editor).

My personal preference (in the short term) is to just get rid of the OS
lock, and go back to rename-into-place for dirstate.  On windows 'bzr
status' with changes will fail to update the file when some other action
is reading the file (but we already have that, and worse).

The file has this great promise that doing "bzr status foo" could read
only a bit of the file (bisecting) and give results. But our code makes
it difficult to pass this information down to where we need it, so that
we are sure that "foo" isn't actually the root of the whole tree. (Or a
subdir with the bulk of content underneath it.)

Its been >1 yr since dirstate was release in bzr 0.15, so I'm hesitant
to say "we'll get partial reading Real Soon Now".

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkiZoMgACgkQJdeBCYSNAAMTKwCgz00BsfTPMps+CqZXLrHEZz/h
TC8AnjxoqwexB0b4iiyDQELGUAQ+K1ty
=Qmxz
-----END PGP SIGNATURE-----



More information about the bazaar mailing list