Reuse prepared cache write on redirected request#11542
Merged
JosiahWI merged 2 commits intoapache:masterfrom Jul 23, 2024
Merged
Reuse prepared cache write on redirected request#11542JosiahWI merged 2 commits intoapache:masterfrom
JosiahWI merged 2 commits intoapache:masterfrom
Conversation
JosiahWI
commented
Jul 12, 2024
5bedf90 to
50ee499
Compare
56fe317 to
938ae15
Compare
JosiahWI
commented
Jul 15, 2024
This reproduces a variant of apache#9275 where we fail on the cache lookup. If the cache lookup were to succeed, it should also fail on the cache write, so this one test should cover both bugs.
Fixes apache#9275. When there is no parent proxy and ATS is following a redirect, it will do a cache lookup on the redirected request. If that lookup results in a cache miss, it will start to prepare a new cache write, which is wrong. The state machine intentionally leaves the write open so we can re-use the connection; this is possible to ascertain from the code and from comments to that effect. We should only open a new write if we don't already have one, when following a redirect.
938ae15 to
ce09429
Compare
vmamidi
approved these changes
Jul 23, 2024
Contributor
|
Cherry-picked to v10.0.x |
cmcfarlen
pushed a commit
that referenced
this pull request
Jul 26, 2024
* Add AuTest to reproduce #9275 This reproduces a variant of #9275 where we fail on the cache lookup. If the cache lookup were to succeed, it should also fail on the cache write, so this one test should cover both bugs. * Reuse prepared cache write on redirected request Fixes #9275. When there is no parent proxy and ATS is following a redirect, it will do a cache lookup on the redirected request. If that lookup results in a cache miss, it will start to prepare a new cache write, which is wrong. The state machine intentionally leaves the write open so we can re-use the connection; this is possible to ascertain from the code and from comments to that effect. We should only open a new write if we don't already have one when following a redirect. (cherry picked from commit 875463c)
JosiahWI
added a commit
to JosiahWI/trafficserver
that referenced
this pull request
Aug 16, 2024
This reverts commit 875463c.
JosiahWI
added a commit
to JosiahWI/trafficserver
that referenced
this pull request
Aug 16, 2024
This reverts commit 6d55a20.
JosiahWI
added a commit
that referenced
this pull request
Aug 16, 2024
bneradt
pushed a commit
to bneradt/trafficserver
that referenced
this pull request
Apr 15, 2025
…" (apache#11706) (apache#1044) This reverts commit 6d55a20. (cherry picked from commit 78b930e) Co-authored-by: JosiahWI <41302989+JosiahWI@users.noreply.github.com>
This was referenced Aug 5, 2025
bneradt
added a commit
to bneradt/trafficserver
that referenced
this pull request
Aug 6, 2025
This reverts commit 875463c.
Contributor
|
We need to close issue #10955 after cherry picking this PR to the 9.2.x branch. |
ezelkow1
pushed a commit
to ezelkow1/trafficserver
that referenced
this pull request
Oct 13, 2025
* Add AuTest to reproduce apache#9275 This reproduces a variant of apache#9275 where we fail on the cache lookup. If the cache lookup were to succeed, it should also fail on the cache write, so this one test should cover both bugs. * Reuse prepared cache write on redirected request Fixes apache#9275. When there is no parent proxy and ATS is following a redirect, it will do a cache lookup on the redirected request. If that lookup results in a cache miss, it will start to prepare a new cache write, which is wrong. The state machine intentionally leaves the write open so we can re-use the connection; this is possible to ascertain from the code and from comments to that effect. We should only open a new write if we don't already have one when following a redirect. (cherry picked from commit 875463c)
ezelkow1
added a commit
that referenced
this pull request
Oct 14, 2025
* Add AuTest to reproduce #9275 This reproduces a variant of #9275 where we fail on the cache lookup. If the cache lookup were to succeed, it should also fail on the cache write, so this one test should cover both bugs. * Reuse prepared cache write on redirected request Fixes #9275. When there is no parent proxy and ATS is following a redirect, it will do a cache lookup on the redirected request. If that lookup results in a cache miss, it will start to prepare a new cache write, which is wrong. The state machine intentionally leaves the write open so we can re-use the connection; this is possible to ascertain from the code and from comments to that effect. We should only open a new write if we don't already have one when following a redirect. (cherry picked from commit 875463c) Co-authored-by: JosiahWI <41302989+JosiahWI@users.noreply.github.com>
bneradt
pushed a commit
to bneradt/trafficserver
that referenced
this pull request
Jan 23, 2026
…he#1120) * Add AuTest to reproduce apache#9275 This reproduces a variant of apache#9275 where we fail on the cache lookup. If the cache lookup were to succeed, it should also fail on the cache write, so this one test should cover both bugs. * Reuse prepared cache write on redirected request Fixes apache#9275. When there is no parent proxy and ATS is following a redirect, it will do a cache lookup on the redirected request. If that lookup results in a cache miss, it will start to prepare a new cache write, which is wrong. The state machine intentionally leaves the write open so we can re-use the connection; this is possible to ascertain from the code and from comments to that effect. We should only open a new write if we don't already have one when following a redirect. (cherry picked from commit 875463c) Co-authored-by: JosiahWI <41302989+JosiahWI@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #9275.
When there is no parent proxy and ATS is following a redirect, it will do
a cache lookup on the redirected request. If that lookup results in a cache
miss, it will start to prepare a new cache write, which is wrong. The state
machine intentionally leaves the write open so we can re-use the connection;
this is possible to ascertain from the code and from comments to that effect.
We should only open a new write if we don't already have one, when following
a redirect.