Bug 46949 - Apache httpd serves sometimes content from another thread
Summary: Apache httpd serves sometimes content from another thread
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: All (show other bugs)
Version: 2.2.11
Hardware: Sun Solaris
: P4 critical (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
Keywords: FixedInTrunk, PatchAvailable
Depends on:
Reported: 2009-04-01 01:22 UTC by Sander de Boer
Modified: 2017-05-09 15:45 UTC (History)
2 users (show)


Note You need to log in before you can comment on or make changes to this bug.
Description Sander de Boer 2009-04-01 01:22:39 UTC
I have upgraded my apache 2.2.6 box with the _prefork_ mpm to apache
2.2.11 with the _worker_ mpm. It's a reverse proxy for 2 backend tomcat(ajp)
servers. Apache is also used as balancer.

<Proxy balancer://patmos>
  BalancerMember ajp://tomcat2:8009 route=mmbase01 min=5 smax=10 max=15
  BalancerMember ajp://tomcat1:8009 route=mmbase02 min=5 smax=10 max=15

Since this upgrade apache serves sometimes wrong content. It seems that the
served content comes from another thread. Something like a thread-safe problem.

After this upgrade I tried figure out what the problem is. A downgrade to 2.2.6 with _worker_ mpm resolve the problem. After that I upgraded to 2.2.10 without problems again.

My conclusion: This bug is introduced in 2.2.11.
Comment 1 Ruediger Pluem 2009-04-01 08:10:56 UTC
Please provide

- A small test case including a small web application and a request that shows the behaviour
- The Tomcat version you are using and what kind of Tomcat connector you are using
- What clients trigger this issue (e.g. which browser, is it a POST or a GET request)
- A network sniff that exposes the problem
Comment 2 Ruediger Pluem 2009-04-01 08:13:34 UTC
Please provide the lines in the error log file containing proxy:
Comment 3 Rainer Jung 2009-04-02 14:34:25 UTC
Since this seems to be difficult to reproduce in general, and it's easy for you, could you please confirm, that your 2.2.10 and 2.2.11 tests were done on the same systems, using the same backends, both versions using worker MPM, same version of the APR libraries and same configuration?

If yes, then it should be interesting to redo the tests with

- httpd 2.2.10 using mod_proxy, mod_proxy_ajp and mod_proxy_balancer from 2.2.11
- the other way round, using httpd 2.2.11 and the proxy modules from 2.2.10

As far as I can see, the mixed environments should work in principle. In case the problem shows only up with one of the two combinations we would know, whether the root cause is in the core or the proxy modules.

Of course the info requested in comments #1 and #2 will be very helpful as well.
Comment 4 Sander de Boer 2009-04-03 04:26:20 UTC
I am using apache-tomcat-6.0.16 with the following connector:
  <Connector port="8009" protocol="AJP/1.3" redirectPort="443" maxThreads="512" enableLookups="false" />

This bug is hard to reproduce. It seems that this is only a problem onder load. Even on a test envoirement I can't reproduce it.

Because many of our clients complain to this issue, I set up a wget loop that downloaded a test.jsp containing the word 'hello'. In this way I saw there was sometimes other content downloaded than the word 'hello'.

I think that the errors in the error log are not related to this issue, because the time doesnt match:
[Sun Mar 29 16:35:00 2009] [error] proxy: read zero bytes, expecting 1902 bytes
[Sun Mar 29 16:38:03 2009] [error] proxy: read zero bytes, expecting 1902 bytes
[Sun Mar 29 16:51:49 2009] [error] proxy: read zero bytes, expecting 1902 bytes

I will try a mixed version of .10 and .11, but first weekend!
Comment 5 Ruediger Pluem 2009-04-08 14:12:15 UTC
Committed a fix to trunk (r763394) that was tested successfully by Sander.
Comment 6 Ruediger Pluem 2009-04-08 14:26:30 UTC
A patch for 2.2.11 can be also found in some hours at the mirrors and at http://www.apache.org/dist/httpd/patches/apply_to_2.2.11
Comment 7 Jakob Ericsson 2009-04-17 00:22:45 UTC
We are experiencing the same problem on Windows 2003 server (httpd 2.2.11).
Will patch be available in 2.2.12?
Comment 8 Ruediger Pluem 2009-04-25 02:59:23 UTC
Backport to 2.2.x as r768506.
Comment 9 Daniele 2017-05-09 15:45:01 UTC
Can you confirm that this problem has been fixed on Apache 2.4.x? Many thanks!