[Yum-devel] locking

James Antill james.antill at redhat.com
Thu Feb 21 15:45:37 UTC 2008


On Thu, 2008-02-21 at 10:21 -0500, seth vidal wrote:
> On Thu, 2008-02-21 at 16:17 +0100, Florian Festi wrote:
> 
> > If it gets implemented that simple we can get deadlocked quite easily.
> > 
> > instance 1: lock repo1
> > instance 2: lock repo2
> > instance 1: lock repo2 -> wait
> > instance 2: lock repo1 -> wait -> deadlock
> 
> 
> No.
> instance 1: lock repo1, do what you have to do, unlock repo1
> instance 2: lock repo2, do what you have to do, unlock repo2
> instance 1: lock repo2, wait until instance 2 unlocks, continue.
> 
> How are we deadlocking there?
> 
> You're thinking of the lock being for the entire runtime of the program,
> I'm thinking of the lock being for the time during which we are
> WRITING/downloading info.

 How does this work?

instance 1:

	lock repo X.
	get repomd.xml and new primary
	unlock repo X.

instance 2:

	lock repo X.
	get repomd.xml and new primary
	get filelists
	unlock repo X.

instance 1:

	lock repo X.
	get filelists

...there is no guarantee that instance 2 didn't change the
repomd/primary/etc.

-- 
James Antill <james.antill at redhat.com>
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.baseurl.org/pipermail/yum-devel/attachments/20080221/a32526a2/attachment.pgp 


More information about the Yum-devel mailing list