Bug 63891 - Balancer failover fails for POST with small request Body and CL set
Summary: Balancer failover fails for POST with small request Body and CL set
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_proxy_http (show other bugs)
Version: 2.4.41
Hardware: All All
: P2 major (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-29 13:51 UTC by Rainer Jung
Modified: 2019-10-29 13:51 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rainer Jung 2019-10-29 13:51:46 UTC
Since r1860166 in 2.4.41 the order of request body prefetch and backend connect changed. This is due to backporting r1656259 "mod_proxy_http: don't connect or reuse backend before prefetching request body." or parts of it with the same commit.

Now when a POST request has a small body that fits into the prefetch buffer and has CL set plus the request to the first backend in the balancer fails during the TCP connect to this backend, the failed over request will be send to the next backend with a CL of 0.

Order of execution:

2.4.39:

In proxy_http_handler():
- ap_proxy_determine_connection()
- ap_proxy_check_connection()
- optionally ap_proxy_connect_backend() which might fail.
- ap_proxy_connection_create_ex()
- ap_proxy_http_request() which does prefetch late!

2.4.41:

In proxy_http_handler():
- ap_proxy_determine_connection()
- early ap_proxy_http_prefetch() which does the prefetch!
- optionally again ap_proxy_determine_connection()
- ap_proxy_check_connection()
- optionally ap_proxy_connect_backend() which might fail.
- ap_proxy_connection_create_ex()
- ap_proxy_http_request()

Regards,

Rainer