https://bz.apache.org/bugzilla/show_bug.cgi?id=65655

            Bug ID: 65655
           Summary: Wrong ProxyTimeout is effective for reused connections
                    to backend when vhosts with different configuration
                    share a balancer
           Product: Apache httpd-2
           Version: 2.4.51
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_proxy
          Assignee: bugs@httpd.apache.org
          Reporter: szymek....@gmail.com
  Target Milestone: ---

Created attachment 38078
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=38078&action=edit
httpd.conf that can be used to reproduce the issue

I have a <Proxy> with a single backend server. I use that <Proxy> in 2
<VirtualHost> definitions to proxy all requests to that single backend server.
One of them has ProxyTimeout set to 1s, the other one has ProxyTimeout set to
10s. Let's say I make a request to the vhost with 1s proxy timeout. Apache
hands it off to a worker, which then opens a connection to the backend server
and configures it to have 1s timeout. After this request is handled I make a
second request, this time to the vhost with 10s proxy timeout. Let's say apache
hands it off to the same worker. That worker sees that it already has a
connection open from when it was serving the first request and it reuses it,
including the 1s timeout from the first vhost. This means that my request will
time out after 1 second, even though the vhost is configured to time out after
10 seconds. This doesn't happen if I disable connection reuse via
enablereuse=Off on BalancerMember.

If it's possible to reconfigure the reused connection according to the
configuration in the <VirtualHost> that's being currently served then I believe
the current behavior is a bug and should be corrected. Alternatively, if a
worker should have separate connection pools for serving different vhosts then
I also believe the current behavior is a bug and should be corrected. If
neither of these is the case, then I think this behavior should be explained in
the documentation (connection reuse when sharing a balancer between vhosts with
different configuration leads to inconsistencies).

I attached an httpd.conf that can be used to reproduce this issue.
The proxy in it uses 172.17.0.2 as backend. In my case it pointed to a mock
server that responded after a configured amount of time.

Apache/2.4.51 (Unix) Server built: Oct 25 2021 07:28:57
I'm using macos on an intel-based platform, but I used an alpine-based Docker
image of apache to test this. You can find it here:
https://github.com/docker-library/httpd/blob/4d89a55e9e5742bebd10fddf83ffb07f2df4d7a0/2.4/alpine/Dockerfile

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscr...@httpd.apache.org
For additional commands, e-mail: bugs-h...@httpd.apache.org

Reply via email to