Possible deadlock and solution

Matthias Andree matthias.andree at gmx.de
Sun Sep 29 23:42:45 CEST 2002


On Sun, 29 Sep 2002, Gyepi SAM wrote:

> I know it is not overly complex, but the current solution is simpler yet.
> Note that the new parameter simply determines which databases are locked,
> and not the order, which is built into the function.

I have been through this with leafnode, and burnt my fingers.

What is being put up here is code for the moment. It works now, and it
is correct now. But if it's left alone and in some months somebody gets
back to it and changes it, this might turn into a time bomb, and later,
someone is going to fix bugs we can avoid now. We have some implicit
assumptions not directly visible from the API.

We can put the whole locking stuff into a separate API, like lock_list,
which tries all locks in order, rolls back everything in reverse order
as soon as one attempt fails, and that's it.

10, maybe 20 lines of code.

-- 
Matthias Andree



More information about the bogofilter-dev mailing list