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

Re: [leafnode-list] Cannot allocate memory?



jom1@xxxxxxxxxx writes:

> Sorry but I don't agree with you.
> I understand that the "lockfile_exists" 1.9.19 has a TOC-TOU race (time of
> check - time of use), but this is not a real problem, because we need a task
> locking, not a file locking.

1. It's finer grained than that, we need to protect the groupinfo file from
concurrent updates in the first place, which implies obtaining the lock
before reading it.

2. A lockfile function that can fall prey to race conditions is worth
exactly nothing and can be discarded.

Other files, like .overview, will be rebuilt and moved into place
atomically (rename(2)), so concurrent runs may just lead to some kind of
fighting for the most current of these files, but will not usually do
harm.

However, I've not had my hands on leafnode 1.9 for a long time, and I
may be wrong, I've been focusing on 2.0beta for quite some time. The
code bases have diverged somewhat, and I personally only fix the major
bugs in 1.9, and the lockfile has been the next-to-last reported, the
last one is the NewsCache incompatibility (NewsCache lies to us on STAT
and leafnode discards the article.)

> Of course if you start in a cron job fetchnews and texpire at *exactly* the
> same time, you may encounter some problems... but this is your
> responsibility.

Say they each start at different time. Can you guarantee fetchnews has
completed when texpire is supposed to start? I cannot.

Fixing the lock function to be reliable is no magic and no luxury
either. The bugfix is there and there is no reason not to apply it, but
you choose, it's your system.

> I am missing something else ?

Maybe I'm also missing something here.

> P.S.
> applyfilter also need the task locking for this task must not run
> concurrently with fetchnews or texpire, but the groupinfo file should not be
> modified: this is absolutely useless and also a waste of time.

Excuse me? If applyfilter discards the article with the lowest number(s)
in that particular group, so the low water mark may have to be adjusted
-- that would mean touching groupinfo.

It may be that the 1.9 applyfilter does not lock at all.

-- 
Matthias Andree

"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety."         Benjamin Franklin

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