You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Serge Knystautas <se...@lokitech.com> on 2002/04/20 01:32:37 UTC

Re: Found Problem with Retries and Bounces

Steve,

This is a good point... although I've patched the FileRepository so that 
it does properly not save over itself and obliterate the mime message, 
it does still leave your point as valid (about it not being on disk for 
a bit of time).  Perhaps I should save to a temp file and then delete 
the old copy and copy the temp over it.  Doesn't mail.dir do something 
like this where it documents how it saves to a new file and copies the 
temp over the original?
-- 
Serge Knystautas
Loki Technologies - Unstoppable Websites
http://www.lokitech.com/

Steve Short wrote:
> Serge,
> 
> I something like that in LinearProcessor, it saves to a new file each time
> the message status has been changed, but I don't see this in RemoteDelivery.
> For now I have simply added a call to saveChanges() immediately prior to the
> call to store().  While this is simple and it works, it is less than ideal
> because it opens a small window when the data does not exist on disk and
> would therefore be lost during a system failure.
> 
> Regards
> Steve
> 
> -----Original Message-----
> From: Serge Knystautas [mailto:sergek@lokitech.com]
> Sent: Tuesday, March 05, 2002 11:54 AM
> To: James Developers List
> Subject: Re: Found Problem with Retries and Bounces
> 
> 
> Thanks for the analysis.  I think what I did was changing RemoteDelivery to
> save to a new file... I can also change the MimeMessageWrapper to check
> where the file is saved and accordingly move the old file to a temp location
> or something like that.
> 
> Serge Knystautas
> Loki Technologies - Unstoppable Websites
> http://www.lokitech.com/
> ----- Original Message -----
> From: "Steve Short" <St...@PostX.com>
> To: "James Dev (E-mail)" <ja...@jakarta.apache.org>
> Sent: Tuesday, March 05, 2002 2:14 PM
> Subject: Found Problem with Retries and Bounces
> 
> 
> 
>>OK I have found the basic cause of the message header information being
> 
> lost
> 
>>during retries of temporary failures.  Basically the MimeMessageWrapper
>>doesn't fully load the data file until it is actually needed, it stores a
>>reference to a MimeMessageSource instead.  When RemoteDelivery updates the
>>message status and retry count, it attempts to store() the updated
> 
> message.
> 
>>What happens is that store() creates a new FileOutputStream, which
> 
> truncates
> 
>>the file to 0 bytes, then tells the message object to write itself to the
>>new file.  MimeMessageWrapper realises that it needs to read the header
> 
> data
> 
>>from it's MimeMessageSource and tries to do so, but this file has just
> 
> been
> 
>>wiped.  Therefore the data has been lost.
>>
>>Regards
>>Steve


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>