[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Question on lock behaviour

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2005-04-10 19:18:50 CEST

Ben Collins-Sussman wrote:
> On Apr 9, 2005, at 4:12 AM, Norbert Unterberg wrote:
>> * Is it allowed to lock multiple files in one command, like
>> "svn lock *.bin"?
>
> Yes.
>
>> If yes, is this some kind of an atomic operation, meaning:
>
> It's not atomic as a group, each attempt to lock a file is a separate
> event that could fail or succeed.
>
>> - repository lock-hook called once with a file list or once per file?
>
> At the moment, yes, but that will probably change in 1.3. The new lock

I think Ben means "At the moment, it is called once per file."

> hooks are designed to work on lists of files, but they're not being
> invoked that way (yet.)
>
>> - no problem with concurrency when two users try the lock the same
>> group of files at the same time.
>
> There is absolutely a race. Someone gets the lock first, the other is
> bounced out. Just like commits.

That answer applies to each file individually, so the answer to locking a group
of files is that you may end up with some of the files locked by one user and
some by another. That is, it is not atomic.

(Is this true for all RA methods etc. or only some of them? It's a shame if we
can't eventually make lock-group-of-files be an atomic operation.)

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Apr 10 19:20:49 2005

This is an archived mail posted to the Subversion Dev mailing list.