[prev in list] [next in list] [prev in thread] [next in thread] 

List:       james-dev
Subject:    Re: James spool and threads
From:       Gabor Kincses <npure2001 () yahoo ! com>
Date:       2005-04-29 19:37:34
Message-ID: 20050429193734.81401.qmail () web20127 ! mail ! yahoo ! com
[Download RAW message or body]


--- apache@bago.org wrote:
> > > the only notify is at the end of store() but
> there is no 
> > notify at the 
> > > unlock()
> > 
> > store() would be called elsewhere in the code to
> put it into 
> > the next processor, and processor.service()
> doesn't return 
> > until the processor has finished with the message.
> 
> Ok, I found the call to store() :-)
> It is in the LinearProcessor: LinearProcessor will
> call spool.store() if the
> mail.state is changed.
> It could be that the notify called by that store
> doesn't work because the
> mail is still locked when it happens, I will
> investigate on this.

This relates to the missed-notifies concurrent
anti-pattern (usually leads to liveliness problems,
which is usually avoided by the notifyAll kludge). 
Which is why I recommended using something a bit more
reliable like a Barrier or a SyncChannel from
concurrent.jar some time ago.  You can also
synchronize a bunch of parties not just two (pub-sub).

Cheers,
Gabor

> > [...]
> > If you don't call store, you won't persist the
> change in 
> > state, which would have an impact if the server
> were restarted.
> 
> If you have a single linear processor with 100
> mailet then the state is only
> changed at the end of the processor and you restart
> james it will restart
> the processing from the first matcher/mailets. If
> you have 10 processors
> with 10 mailets and they are called in sequence then
> currently james store
> the messageState at each processor change. There is
> more granularity in the
> message state but this is not atomic anyway.
> 
> My idea is to have a single spoolThread to bring an
> email from the first
> processor to the last one as if it were a single
> processor.
> 
> Stefano
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail:
> server-dev-help@james.apache.org
> 
> 

Gabor Kincses
Running Mandrake Linux 10.0

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic