I found this post while researching the mail list archives for a problem 
I am having. The description Henri provides sounds exactly like what is 
happening with my application. I have included the original threads below.

Prior to reading this posting I had not come to Henri's conclusion:

"Under certain conditions some request get the response for some other request"

I was convinced my problem was related to how I was handling sessions, 
or how Tomcat recycles them. But I have exhausted all resources I can 
think of or find. This is the only thing I have found that comes close 
to my problem. I will admit upfront that I am no expert in Tomcat 
configuration.

Four or five users have contacted me with the same issue, which is 
basically that when they login to my app they see data intended for 
another user. Load is probably 40 to 50 concurrent users. I cannot 
reproduce the problem and it seems to be very isolated, with only a few 
occurences over the past week or so.

My environment is Red Hat Linux 7.2, Tomcat 3.3.1, Apache 1.3.22, 
Postgres 7.1.3. User authentication is performed against Postgres and 
userid is stored in a session attribute, along with a few other attributes.

In the 3.3.1 release notes bug 6234 was listed as resolved. I read the 
contents of the bug and tried the TestServlet you provided to reproduce 
the error. I still couldn't reproduce the problem which would make since 
if I am running a version of Tomcat that is supposed to include the fix. 
I also ran the TestServlet on 3.2.3 and couldn't reproduce. Although 
nothing indicates that the bug existed prior to 3.3.

In the TestServlet you indicate that the workaround is to use 
response.getOutputStream() instead of response.getWriter(). I am using 
getOutputStream().

I realize that I may not have the same problem but would appreciate any 
insight you could provide.


-------Original Threads---------

Actually, you don't need to load the system (that's the good news).  It's
not a synchronization problem.  It looks like it is a problem with error
handling, but I haven't tracked down where so I can't send a patch yet.  It
seems that when you get an error, the writer gets stuck in it's last
successful request and always sends that one.  I've reverted
HttpServletResponseFacade to always throwing away it's writer on recycle (so
that my developers can actually get work done)  as a stop-gap and that seems
to have made it go away.  Of course, this is far from ideal.  What you need
to start seeing this is something like:

public class BadServlet extends HttpServlet {

  protected void doGet(HttpServletRequest request, HttpServletResponse
response)
      throws ServletException, IOException {
         PrintWriter out = response.getWriter();
         out.println("Hello World");
         throw new IOException("Hi Mom!");
    }
}
----- Original Message -----
From: "GOMEZ Henri" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 03, 2001 7:45 AM
Subject: RE: Ajp13 wrong Response


> Very difficult to reproduce a situation under heavy load.
> I stressed my Apache/TC with ab during nigths without
> any failures but It was against simple servlets
>
> -
> Henri Gomez                 ___[_]____
> EMAIL : [EMAIL PROTECTED]        (. .)
> PGP KEY : 697ECEDD    ...oOOo..(_)..oOOo...
> PGP Fingerprint : 9DF8 1EA8 ED53 2F39 DC9B 904A 364F 80E6
>
>
>
> >-----Original Message-----
> >From: Angel Aray [mailto:[EMAIL PROTECTED]]
> >Sent: Tuesday, July 03, 2001 2:46 PM
> >To: [EMAIL PROTECTED]
> >Subject: RE: Ajp13 wrong Response
> >
> >
> >
> >I'll try that, but the problem I am seeing is with tomcat as late
> >as TC 3.3-M3.
> >
> >-----Original Message-----
> >From: GOMEZ Henri [mailto:[EMAIL PROTECTED]]
> >Sent: Martes, 03 de Julio de 2001 04:10 a.m.
> >To: [EMAIL PROTECTED]
> >Subject: RE: Ajp13 wrong Response
> >
> >
> >>> I am having a problem which is very difficult to reproduce.
> >>Under certain
> >>> conditions some request get the response for some other
> >>request. It looks
> >>> like at some point probably due to some synchronization
> >issues tomcat
> >>> mixes de responses from different clients.
> >
> >It was a known problem in early age of TC 3.3, with RequestDispatcher.
> >Could you try a fresh install of TC 3.3-M4 ?
> >
> >>> I hadn't seen this behavior before, but since I moved  from
> >>using just
> >>> tomcat to using apache + mod_jk + tomcat it has occurred a couple of
> >>times.
> >>>
> >>> Has anyone seen this kind of behavior before?
> >>>
> >>>
> >>> I am using apache_1.3.20, tomcat33-m3.
> >>>
> >>>
> >>
> > 



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to