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 Steve Brewin <sb...@synsys.com> on 2011/12/02 14:46:51 UTC

How to handle ReadOnlyUsersLDAPRepository Connection Failures

Hi

org.apache.james.user.ldap.ReadOnlyUsersLDAPRepository obtains its
connection to the LDAP repository during init() processing and thereafter
assumes it to be valid. When, as may sometimes temporarily or permanently
occur, the connection becomes invalid the resulting
javax.naming.CommunicationException is propogated to the caller and no
attempt is made to reestablish the connection. James must be restarted to
reestablish the connection, which many users will consider unacceptable.

To correct this, I'm thinking of modifying
org.apache.james.user.ldap.ReadOnlyUsersLDAPRepository in the following
ways:

1) Make the connection timeout period configurable
2) Introduce the capability to retry connections a configurable number of
times

The only downside of this I can think of is that the fast fail
ValidRcptHandler will take up to 'connection timeout period * number of
retry attempts' to respond. Still, this is better than bringing the house
down as currently happens should the LDAP repository connection be lost!

Other thoughts anyone?

Cheers
--Steve


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


Re: How to handle ReadOnlyUsersLDAPRepository Connection Failures

Posted by Norman Maurer <no...@googlemail.com>.
I think adding some retry makes sense here. So go ahead...

Bye,
Norman


2011/12/2 Steve Brewin <sb...@synsys.com>

> Hi
>
> org.apache.james.user.ldap.ReadOnlyUsersLDAPRepository obtains its
> connection to the LDAP repository during init() processing and thereafter
> assumes it to be valid. When, as may sometimes temporarily or permanently
> occur, the connection becomes invalid the resulting
> javax.naming.CommunicationException is propogated to the caller and no
> attempt is made to reestablish the connection. James must be restarted to
> reestablish the connection, which many users will consider unacceptable.
>
> To correct this, I'm thinking of modifying
> org.apache.james.user.ldap.ReadOnlyUsersLDAPRepository in the following
> ways:
>
> 1) Make the connection timeout period configurable
> 2) Introduce the capability to retry connections a configurable number of
> times
>
> The only downside of this I can think of is that the fast fail
> ValidRcptHandler will take up to 'connection timeout period * number of
> retry attempts' to respond. Still, this is better than bringing the house
> down as currently happens should the LDAP repository connection be lost!
>
> Other thoughts anyone?
>
> Cheers
> --Steve
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
>
>