Maxime,

>   From what I understand, the spool is like a producer/consumer queue, 
> from which the JamesSmtp server
> enqueues mails, and mailet threads asynchronously dequeue mails for 
> processing. The enqueue and dequeue operations
> both have a small window where duplication can occur.


Almost.. in fact the dequeue operation occurs in two stages, first a mail is locked by 
james, preventing its access by other de-spooling threads.
Processing by the mailets occurs.
The mail is then removed, or moved to another spool (for another processor).

The opportunity for duplication of mail occurs in the processing step, where a mailet 
may have completed processing and mark the mail to be removed from the spool, or moved 
to another spool. 
Termination at this point is possible before the actual removal/move is actioned. 
The spool action is only carried out by the container after the service method returns.
The likelyhood of this being encoutered during an abnormal termination obvoiusly 
increases as the time after marking the message but before the service method returns 
increases.

In normal operation the de-spooling of messages into the processor containing your 
mailet does not result in duplication, what happens in practice is the reverse,  that 
another thread may obtain a lock on a message which no-longer exists.

d.


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to