On January 22, 2003 08:55 am, Claudio Jeker wrote:
> Here is another patch to test.
>
I ran a little test sending 10 messages concurrently (over smtp) from
10 different non-local senders to the same mailbox.
For each message an auto-reply was queued, but the .qmail-reply.db
wasn't updated with all ten addresses. Out of five runs, the
reply.db had 7 senders twice and 5 senders the other 3 times.
> The db file is now written to a temp file. So the file is not
> truncated or corrupted but it is possible that a sender recieves
> more than one mail. This solution is the most robust and fails not
> horribly over nfs.
I saw the pid is appended to the reply.db file, so wouldn't that mean
more than one sender arriving at the same time would truncate the
main db file? I tried commenting the pid part out but it made things
worse (only two addresses got added to the db - guess the race
matters ;>). How about introducing random wait, so if five senders
come in at the same time, they all wait a different number of seconds
before trying the stat()?
-neil