From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id ABAE1BC69 for ; Fri, 13 Apr 2007 08:39:13 +0200 (CEST) Received: from smtp3-g19.free.fr (smtp3-g19.free.fr [212.27.42.29]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l3D6dDEW009251 for ; Fri, 13 Apr 2007 08:39:13 +0200 Received: from [192.168.0.1] (rke75-3-82-229-183-156.fbx.proxad.net [82.229.183.156]) by smtp3-g19.free.fr (Postfix) with ESMTP id 153A95E1A7; Fri, 13 Apr 2007 08:39:10 +0200 (CEST) Message-ID: <461F258E.5030905@inria.fr> Date: Fri, 13 Apr 2007 08:39:10 +0200 From: Alain Frisch User-Agent: Thunderbird 2.0.0.0 (X11/20070326) MIME-Version: 1.0 To: Ian Zimmerman Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] [OT?] spamoracle concurrency References: <87ps68u7ub.fsf@unicorn.ahiker.homeip.net> In-Reply-To: <87ps68u7ub.fsf@unicorn.ahiker.homeip.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 461F2591.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; frisch:01 frisch:01 slap:01 unix:01 wrote:01 caml-list:01 zimmerman:01 alain:01 alain:01 concurrency:02 ian:03 let:03 rename:04 scheme:05 parallel:05 Ian Zimmerman wrote: > The question is: does spamoracle do any kind of locking on the database? > And what kind? Clearly, if I pipe my mails through "spamoracle mark" in > my procmail (or maildrop, etc.) configuration, spamoracle may run and > access the database at completely unpredictable times. Is it safe to > do "spamoracle add" while this is enabled? Or do I have to slap a > locking scheme on top myself? > > Bonus question, if locking is in fact done, does it let multiple > "spamoracle mark" processes through at the same time (which should be safe)? Looking at the code very: spamoracle write its database to a fresh temporary file and then rename it. With a local file system (not NFS) under Unix, this is atomic. It is thus safe to "mark" and "add" in parallel, but if you do several "add" in parallel, you'll not get the expected behavior (but the database will not be corrupted). -- Alain