james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefano Bagnara" <apa...@bago.org>
Subject Re: Spoolmanager blues
Date Tue, 06 Sep 2005 14:08:25 GMT
> > Soren wrote:
> > > I am having trouble with the JamesSpoolManager in the trunk.
> > > I experience mails hanging in the spool, it looks like 
> the offending 
> > > piece of code is the return statement in line 418.
> To be clear, that is the return statement in 
> process(MailImpl) that does a return after a processor has 
> successfully handled the message?


> > > The reason I suspect that line is that I cannot reproduce 
> the effect 
> > > if I remove the line.
> For some reason, I had thought that Stefano was changing the 
> spooler to process the entire pipeline for an e-mail in one 
> shot, rather than queuing for each processor, but since he 
> just said that he hadn't made the change, and obviously the 
> code doesn't have it, perhaps it was just something he had 
> talked about.  I seem to recall being concerned about that change.

I just talked about it.
I also changed it locally and attached a patch to a JIRA issue but it was
not working so I commented this on JIRA and never applied changes that way.

> > I'm experiencing spooling issues with file repositories too.
> Actually, I have occassionally seen the same symptom with JDBC, too.

Simple delay of messages or full hangs of single messages?

> > If you send more mails you will see that the one in the spool will 
> > start being elaborated.
> The problem *appears* to be with notify().  This is why I 
> have wanted us to simplify the logic by having one spool 
> thread and plain worker threads that just process what they are given.

I now understand better the spooling mechanism and it's not an easy change
mainly because the contract between mail/spool repositories and james is not
clear enough. What is threadsafe in a repository? What is the correct use of
locking/unlocking? Can I store the same message in 2 different repositories?
Is it safe to store the same message in the same repository multiple times?

Currently we run the notify when the message is stored but when the message
is stored we still got the lock on the Mail (unless it was generated by a
matcher split/duplicate or by a new sendmail).
When we run the unlock there is no notify so the thread will wait for
another mail and no other spoolthread will get the message we just stored.


To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org

View raw message