On Thu, Jan 09, 2003 at 02:54:34PM +0100, Xavier Beaudouin wrote:
> 
> Le jeudi, 9 jan 2003, � 14:10 Europe/Paris, Sam Varshavchik a �crit :
> 
> > Xavier Beaudouin writes:
> >
> >> Last CVS snapshot of courier-imap introduces a cache system.... but 
> >> in a file... This is also a strange idea, let me explain what.
> >> Writting the cache a in file on a maildir can give some races on a 
> >> complex cases. Imagine you have a pop3 account shared  with 3 users 
> >> and have 3 pop3 server (with data on NFS) behind a lot balancer. How 
> >> can all pop3 servers knows that current pop3 cache file is being 
> >> modified.
> >
> > You don't know what you're talking about.
> 
> Are you sure ? I have a cluster of 6 machines using courier-imap under 
> solaris... With about > 600 000 users, so I may be don't know what I am 
> talking about...

Look at the code for handling the cache file.

1. It opens and reads the courierpop3dsizelist file (if any)

2. For all files which are in the mailbox but not in the cache, it works
   out the size as before. For all files which are in the cache but not in
   the directory listing, they are forgotten about.

3. It then writes the updated cache to a temporary file and then does an
   atomic rename to 'courierpop3dsizelist'. At all instants the file is
   complete and valid. There is no need to lock the file. There is no
   race condition.

The file is never modified, only replaced in its entirety. That's what makes
it safe.

Regards,

Brian.


-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to