[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nmh-workers] Truncated Email.

From: Ken Hornstein
Subject: Re: [Nmh-workers] Truncated Email.
Date: Sun, 06 Mar 2016 12:10:04 -0500

>I don't mean the spool file was inc'd twice, with differing message
>numbers, as has probably happened with the "new messages have arrived"
>mentioned above, but that two scans were produced of the same messages.
>This was surprising.

I _THINK_ I know what happened (the spool file was inc'd twice).  So treat
this as a semi-educated guess.

The scan listing for 'inc' is being generated as it's reading the spool
file.  So the ONLY way for you to get two scans is for you do actually
incorporate the mail twice.  The spool is locked, yes ... but I see from
the code it's unlocked before it gets truncated (that seems like a bug to
me, and that might be the cause of other problems).

But ... because the folder was read at startup both times, it thought that
the start of new messages was at the same point.  So the second inc put
the messages in the same files as the first inc.

Fixing this might be tough ... I don't know how locking behaves when
you truncate a file (although I see that it uses creat() to truncate a
file, rather than ftruncate(); that seems weird to me?).  So maybe it's
not hard.

I'd like to point out that it has never been safe to run two inc's at the
same time, so it's not surprising that this caused problems.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]