You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ted Kirby <te...@gmail.com> on 2007/05/16 17:02:37 UTC

Problem with org.apache.coyote.Request ?

I see that setNote is used to cache objects in the Request object.  I
think these cached objects should be released in the recycle() method,
but I do not see code in there to do so.

I was tracing a problem I was having with a debugger on two different
JVMs.  I was looking at this traceback:
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:543)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:238)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
at java.lang.Thread.run(Thread.java:801)

I was stopping in org.apache.catalina.connector.CoyoteAdapter.service,
and my first time tthere, req.getNote(ADAPTER_NOTES) was not returning
null a Sun 1.5 JVM.  I also added code in the Request constructor to
insure notes was an array of nulls, and that fixed this "problem".

I have attached my fix.

I think not clearing notes in recycle() is a problem.  I was surprised
I seemed to need the code in the constructor.  It is possible that I
did not catch a use of the request object before service(), but I had
a stop in setNote().

It does not seem that setNote() is used very often, and I could not
really see what is was doing.

Ted Kirby

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Problem with org.apache.coyote.Request ?

Posted by Bill Barker <wb...@wilshire.com>.
"Ted Kirby" <te...@gmail.com> wrote in message 
news:3da992810705191238v5c37963fn903fc4b6494826e7@mail.gmail.com...
>I sent this to user list a few days ago, and got no response.  The dev
> list is probably a better place for it.

If the notes array isn't initialized to null, then that means that you have 
a problem with your JVM.

The notes most certainly should not be released in the recycle method.  They 
are intended to last for the entire life of the thread.  The notes are 
intended to be a place where modules can place thread-local variables (from 
the olden days when ThreadLocal was too expensive).

>
> I also see I forgot to attach my patch, which I will do now.
>
> Ted Kirby
>
> ---------- Forwarded message ----------
> From: Ted Kirby <te...@gmail.com>
> Date: May 16, 2007 11:02 AM
> Subject: Problem with org.apache.coyote.Request ?
> To: users@tomcat.apache.org
>
>
> I see that setNote is used to cache objects in the Request object.  I
> think these cached objects should be released in the recycle() method,
> but I do not see code in there to do so.
>
> I was tracing a problem I was having with a debugger on two different
> JVMs.  I was looking at this traceback:
> at 
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:543)
> at 
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:238)
> at 
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
> at 
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
> at java.lang.Thread.run(Thread.java:801)
>
> I was stopping in org.apache.catalina.connector.CoyoteAdapter.service,
> and my first time tthere, req.getNote(ADAPTER_NOTES) was not returning
> null a Sun 1.5 JVM.  I also added code in the Request constructor to
> insure notes was an array of nulls, and that fixed this "problem".
>
> I have attached my fix.
>
> I think not clearing notes in recycle() is a problem.  I was surprised
> I seemed to need the code in the constructor.  It is possible that I
> did not catch a use of the request object before service(), but I had
> a stop in setNote().
>
> It does not seem that setNote() is used very often, and I could not
> really see what is was doing.
>
> Ted Kirby
>


--------------------------------------------------------------------------------


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




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


Fwd: Problem with org.apache.coyote.Request ?

Posted by Ted Kirby <te...@gmail.com>.
I sent this to user list a few days ago, and got no response.  The dev
list is probably a better place for it.

I also see I forgot to attach my patch, which I will do now.

Ted Kirby

---------- Forwarded message ----------
From: Ted Kirby <te...@gmail.com>
Date: May 16, 2007 11:02 AM
Subject: Problem with org.apache.coyote.Request ?
To: users@tomcat.apache.org


I see that setNote is used to cache objects in the Request object.  I
think these cached objects should be released in the recycle() method,
but I do not see code in there to do so.

I was tracing a problem I was having with a debugger on two different
JVMs.  I was looking at this traceback:
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:543)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:238)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
at java.lang.Thread.run(Thread.java:801)

I was stopping in org.apache.catalina.connector.CoyoteAdapter.service,
and my first time tthere, req.getNote(ADAPTER_NOTES) was not returning
null a Sun 1.5 JVM.  I also added code in the Request constructor to
insure notes was an array of nulls, and that fixed this "problem".

I have attached my fix.

I think not clearing notes in recycle() is a problem.  I was surprised
I seemed to need the code in the constructor.  It is possible that I
did not catch a use of the request object before service(), but I had
a stop in setNote().

It does not seem that setNote() is used very often, and I could not
really see what is was doing.

Ted Kirby