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 Stefano Bagnara <ap...@bago.org> on 2005/09/05 13:49:26 UTC

To Anagha (Was: svn commit: r278721)

I've added the "sessionEnded = false" upon connection because James was no
more accepting more than 5-10 messages at a time (connection pooling).
Please note that SMTPHandler's are part of a pool (tipically 10 handlers)
and they are reused for further connections.
We should take care that the handler state is fully cleared (and references
nulled) before returning the handler to the pool.

Please try reproducing the bug, apply the patch and verify it's gone.
I've done a test with the current trunk but my production machine is a trunk
with a lot of custom patches, especially in SMTP handling (for DSN support).

Stefano

> URL: http://svn.apache.org/viewcvs?rev=278721&view=rev
> Log:
> Fixed a major bug in smtp connection handling (james only 
> accepted the first 5-10 smtp connections) (introduced in JAMES-407)
> 
> Modified:
>     
> james/server/trunk/src/java/org/apache/james/smtpserver/SMTPHa
> ndler.java
>     
> james/server/trunk/src/java/org/apache/james/smtpserver/SMTPSe
> ssion.java
> 
> Modified: 
> james/server/trunk/src/java/org/apache/james/smtpserver/SMTPHa
> ndler.java
> URL: 
> http://svn.apache.org/viewcvs/james/server/trunk/src/java/org/
> apache/james/smtpserver/SMTPHandler.java?rev=278721&r1=278720&
> r2=278721&view=diff
> ==============================================================
> ================
> --- 
> james/server/trunk/src/java/org/apache/james/smtpserver/SMTPHa
> ndler.java (original)
> +++ 
> james/server/trunk/src/java/org/apache/james/smtpserver/SMTPHandler.
> +++ java Mon Sep  5 04:34:25 2005
> @@ -297,6 +297,7 @@
>              smtpID = random.nextInt(1024) + "";
>              relayingAllowed = 
> theConfigData.isRelayingAllowed(remoteIP);
>              authRequired = theConfigData.isAuthRequired(remoteIP);
> +            sessionEnded = false;
>              resetState();
>          } catch (Exception e) {
>              StringBuffer exceptionBuffer =
> 
> Modified: 
> james/server/trunk/src/java/org/apache/james/smtpserver/SMTPSe
> ssion.java
> URL: 
> http://svn.apache.org/viewcvs/james/server/trunk/src/java/org/
> apache/james/smtpserver/SMTPSession.java?rev=278721&r1=278720&
> r2=278721&view=diff


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


Re: To Anagha (Was: svn commit: r278721)

Posted by Anagha Mudigonda <an...@gmail.com>.
I am able to reproduce the problem. I applied the patch and tested with a 
SMTP testing tool sent 50 emails using 10 threads. It is working fine.
 I will do code review to ensure that the state of SMTPHandler is properly 
is reset before returning to pool.
 --Anagha


 On 9/5/05, Stefano Bagnara <ap...@bago.org> wrote: 
> 
> I've added the "sessionEnded = false" upon connection because James was no
> more accepting more than 5-10 messages at a time (connection pooling).
> Please note that SMTPHandler's are part of a pool (tipically 10 handlers)
> and they are reused for further connections.
> We should take care that the handler state is fully cleared (and 
> references
> nulled) before returning the handler to the pool.
> 
> Please try reproducing the bug, apply the patch and verify it's gone.
> I've done a test with the current trunk but my production machine is a 
> trunk
> with a lot of custom patches, especially in SMTP handling (for DSN 
> support).
> 
> Stefano
> 
> > URL: http://svn.apache.org/viewcvs?rev=278721&view=rev
> > Log:
> > Fixed a major bug in smtp connection handling (james only
> > accepted the first 5-10 smtp connections) (introduced in JAMES-407)
> >
> > Modified:
> >
> > james/server/trunk/src/java/org/apache/james/smtpserver/SMTPHa
> > ndler.java
> >
> > james/server/trunk/src/java/org/apache/james/smtpserver/SMTPSe
> > ssion.java
> >
> > Modified:
> > james/server/trunk/src/java/org/apache/james/smtpserver/SMTPHa
> > ndler.java
> > URL:
> > http://svn.apache.org/viewcvs/james/server/trunk/src/java/org/
> > apache/james/smtpserver/SMTPHandler.java?rev=278721&r1=278720&
> > r2=278721&view=diff
> > ==============================================================
> > ================
> > ---
> > james/server/trunk/src/java/org/apache/james/smtpserver/SMTPHa
> > ndler.java (original)
> > +++
> > james/server/trunk/src/java/org/apache/james/smtpserver/SMTPHandler.
> > +++ java Mon Sep 5 04:34:25 2005
> > @@ -297,6 +297,7 @@
> > smtpID = random.nextInt(1024) + "";
> > relayingAllowed =
> > theConfigData.isRelayingAllowed(remoteIP);
> > authRequired = theConfigData.isAuthRequired(remoteIP);
> > + sessionEnded = false;
> > resetState();
> > } catch (Exception e) {
> > StringBuffer exceptionBuffer =
> >
> > Modified:
> > james/server/trunk/src/java/org/apache/james/smtpserver/SMTPSe
> > ssion.java
> > URL:
> > http://svn.apache.org/viewcvs/james/server/trunk/src/java/org/
> > apache/james/smtpserver/SMTPSession.java?rev=278721&r1=278720&
> > r2=278721&view=diff
> 
>