On Thu, 16 Jan 2003, Johan Lindh wrote:
I actually had another brainstorm today. Add the file's inode, when
moving the message from tmp to new:
tmp/timestamp.unique_pid.hostname ->
new/timestamp.inode.unique_pid.hostname
Well, if the goal is to eliminate race conditions, this still won't do the
trick.
Remember one of my early mails about this, Sam? Before we took it to the
list.
The race condition causes a collision in new/* vs. cur/*. As long as the
tmp/* name is unique (remember the maildir strategy backs off if there
is a collision in tmp/*), there is no race.
I suggested making one of the always-present daemons a central point
of message names.
Have courierd (for example) simply hand out unique file names on a TCP
port. Simple to do, and completely, absolutely, eliminates all race conditions
and conflicts. You no longer need PID's, inodes or whatever.
You'd essentially have to make all MUAs that are maildir() aware use the
same daemon when for example moving mail from one Maildir to another.
This adds networking code to things that don't need it, so it won't
happen.
OTOH, this might be of more universal interest, and would best be placed
in the kernel.