[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [leafnode-list] File locking

* Cornelius Krasel (krasel@xxxxxxxxxxxxxxxxxxxxxxxxxxxx) [1999-10-07 11:46]:
> Lockfiles are used in Leafnode to avoid race conditions with respect
> to the groupinfo file. That is, only one application that modifies
> the groupinfo file can run at a time (i.e. fetch, texpire and applyfilter
> are mutually exclusive).
> However, if we want to implement local groups there will be a problem,
> because the nntpd itself will have to modify the groupinfo file. It would
> be quite stupid (IMO) if the nntpd would also use the current locking
> mechanism because this would make it impossible to run fetch (or any
> other program) in the background while reading news. Therefore, it would
> be important to come up with a different solution. I have thought quite
> hard about this, but have not come up with a good idea.
> Any of the geeks out there who can help me?

Okay, let's analyse the problem, and also let's watch further than just
leafnode's scope.

The difficulty is: a tool/daemon like fetch/texpire/applyfilter locks
the groupinfo in its entirety for its (the tool's) entire lifetime. 


a) use "in space" finer grained locking, lock only certain "records"
(read: lines) of your groupinfo.

b) use "in time" finer grained locking, only lock the file right before
you change it, then release it. 

c) use caching. Cache the local posts and inject them later. Will
probably require b) so as not to defer local posts for too long.

d) (ATTN! SPOILER!) use suck + inn. 

e) do a sort of journaling. sort of related to c. 

d is probably not an option for leafnode, I admit ;-)

Was just some brainstorming, I hope it was systematic enough and helps
you out of your trap. 

Matthias Andree

Hi! I'm the infamous .signature virus! 
Copy me into your ~/.signature to help me spread!

leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx -- mailing list for leafnode
To unsubscribe, send mail with "unsubscribe" in the subject to the list