Open vuori opened 1 month ago
We might have a fix for this issue on a PR that hasn't been merged yet. @elsloo is going to take a look at it.
@cmcfarlen Was able to reproduce the issue on ATS 10.0.0. @JosiahWI thinks it might be related to PR #11542. @cmcfarlen is going to test 9.2.x and see if he can reproduce the problem on that branch.
PR #11706 reverts #11542 for the 10.0.x branch, so this PR is likely not the issue
On ATS 10.0.0 and 10.0.1-rc0, it seems that when a remap rule has
number_of_redirections
set to a non-zero value, the redirect itself is sometimes cached even though it is not cacheable. The "sometimes" seems to be deterministic for a given set of configuration files, but after changing something unrelated (including comments in config files), the server may flip to a state where things work as expected (redirect is not cached).redirect_use_orig_cache_key
is unset and traffic_ctl shows that it is the default (0).Steps to reproduce:
map http://localhost/ http://localhost/ @plugin=conf_remap.so @pparam=proxy.config.http.number_of_redirections=2
Redirect /aaa1 http://example.com/whatever
curl -x http://localhost:8000 http://localhost/aaa1
, note in HTTP server log that ATS fetches the redirect.Complete debug log is included from the non-working state, I was not able to capture one from a working state. Some interesting parts:
Initial request (step 3) with the redirect fetched from origin:
Redirect is followed and the target is written:
Second request (step 4):
So somehow the redirect target got cached at the location of the redirect. The target has a
Cache-Control
that allows caching, nothing relevant to this target is set incache.config
. The same thing happens regardless of whether any global plugins are enabled. This 10.0.0 was built with cmake defaults on Ubuntu 22.04, though the same thing happens when 10.0.1-rc0 is built on Debian Bookworm.Any suggestions? I looked at the relevant code, but I'm not familiar with the internals of the HTTP state machine and couldn't see anything obviously wrong.
log.txt