Mailing List Archive

[Bug 65348] New: mod_ratelimit of proxied content aborts with long fetches (over 20 seconds)
https://bz.apache.org/bugzilla/show_bug.cgi?id=65348

Bug ID: 65348
Summary: mod_ratelimit of proxied content aborts with long
fetches (over 20 seconds)
Product: Apache httpd-2
Version: 2.4.38
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P2
Component: mod_ratelimit
Assignee: bugs@httpd.apache.org
Reporter: bugs@m8y.org
Target Milestone: ---

Debian (well, Devuan, but same package) stable Apache httpd 2.4.38
Using settings below to simulate a fetch that is about 50 seconds with this
data which is ~2,700,000 bytes long

SetOutputFilter RATE_LIMIT
SetEnv rate-limit 50
SetEnv rate-initial-burst 50

ProxyPass "/apitest" "http://localhost:8085/api"

If I run in wget I get:
2021-06-02 12:16:11 (50.0 KB/s) - Connection closed at byte 2605056. Retrying.
(it then tries infinitely since the remote doesn't support partial)

If I try in Firefox it just aborts with a partial read.

I get the following error in the apache httpd error log.
[Tue Jun 01 17:02:44.531073 2021] [proxy_http:error] [pid 58736:tid
140291765540608] (70008)Partial results are valid but processing is incomplete:
[client 12.34.56.78:60626] AH01110: error reading response

I tried trace6 but didn't see anything else that was particularly interesting.
I've tried the following settings:
Timeout 300
ProxyTimeout 300

SetEnv proxy-sendchunked 1
SetEnv proxy-sendchunks 1 (how are these not default O_o)
SetEnv proxy-interim-request RFC

On the ProxyPass
connectiontimeout=300 timeout=300 disablereuse=On enablereuse=Off

I've confimed that *ALL* of the following work with no issues:
wget --limit-rate=15k http://localhost:8085/api/json (direct connection to
local API)
wget --limit-rate=15k https://server/apitest/json (rate limit on client
side, apache proxy pass, NO rate limit set in apache)
wget https://server/static.json (Rate limit of 50 + static /var/www/html
file)

Only the combination of a rate_limit plus mod_proxy seem to break anything.
If I increase the rate-limit to 200 so that the content fetches in under 15
seconds I no longer get errors.
If I leave the rate-limit at 50 but I reduce the content fetched so it fetches
more quickly (under 15 seconds in this case) I no longer get errors.
It only seems to abort if the content fetches in ~20s or more.

I hunted for related bugs and did find bug #62362 which involved mod proxy and
ratelimit and mentioned a significant recent refactor. I don't know if it is
related in any way though.

--------------------------------1494138182410193280
Content-Disposition: form-data; name="data"; filename=""
Content-Type: application/octet-stream

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