Skip to content

Fix: [ATS 200 response after 302 not cached] (#12369)#12373

Closed
shongkaikai wants to merge 1 commit intoapache:masterfrom
shongkaikai:issue-12369
Closed

Fix: [ATS 200 response after 302 not cached] (#12369)#12373
shongkaikai wants to merge 1 commit intoapache:masterfrom
shongkaikai:issue-12369

Conversation

@shongkaikai
Copy link
Copy Markdown

Fix: [ATS 9.2.x: 200 response after 302 not cached]

With backport markers:

  • Project: 9.2.x
  • Project: 10.x

@zwoop
Copy link
Copy Markdown
Contributor

zwoop commented Jul 22, 2025

Two thoughts:

  1. This doesn't seem complete, assuming it's right, since these parameters are used in several places of the HttpSM.
  2. This was change ~4 years ago, and as far as I can tell, the PR here reverses the changes made then.
commit 1c3a1a41bbf90581a137505f55e06d98fe6aabe1
Author:     Damian Meden <damian.meden@gmail.com>
AuthorDate: Thu May 27 21:06:39 2021 +0100
Commit:     GitHub <noreply@github.com>
CommitDate: Thu May 27 13:06:39 2021 -0700

    Redirect - Make TS to honour the number_of_redirections configuration value (#7867)
    
    This fix includes a unit test to validate the expected behavior.

We'll have to have Damien look at this I think.

@JosiahWI
Copy link
Copy Markdown
Contributor

JosiahWI commented Jul 24, 2025

The code change does not seem related to the issue in the title (which I will link). Why does allowing an extra redirection cycle affect whether we cache the response to any of the other redirected requests? I don't think the number of redirections should affect caching whatsoever if the concerns are properly isolated.

How have you confirmed whether or not this patch resolves your issue?

@shongkaikai
Copy link
Copy Markdown
Author

The code change does not seem related to the issue in the title (which I will link). Why does allowing an extra redirection cycle affect whether we cache the response to any of the other redirected requests? I don't think the number of redirections should affect caching whatsoever if the concerns are properly isolated.

How have you confirmed whether or not this patch resolves your issue?

In the state_read_server_response_header(), When redirection_tries == t_state.txn_conf->number_of_redirections, enable_redirection is set to false, but it should be true at this point.

enable_redirection == false will cause s->cache_info.action = CACHE_DO_NO_ACTION in HttpTransact::handle_forward_server_connection_open, which in turn leads to failure when adding a cache consumer in perform_cache_write_action.

@brbzull0
Copy link
Copy Markdown
Contributor

Hi. I think there is something missing here, this change alone may not fix all things, as this will break some other stuffs. Would it be possible to add an autest for this case?

@apache apache deleted a comment from brbzull0 Jul 28, 2025
@masaori335
Copy link
Copy Markdown
Contributor

From my local test, the master and 10.1.x branch doesn't have the issue. It looks like the solution is #11542 + #12215.
@shongkaikai would you check cherry-picking #11542 and #12215 to the 9.2.x branch?

@cmcfarlen cmcfarlen removed their request for review September 17, 2025 16:26
@bryancall
Copy link
Copy Markdown
Contributor

This is only an issue on the 9.2.x branch and this PR is for master where the issue doesn't exist.

@bryancall bryancall closed this Oct 13, 2025
@bryancall
Copy link
Copy Markdown
Contributor

This issue is also related: #10955. We are going to keep this issue open to track the bug and close others as duplicates.

@ezelkow1 ezelkow1 moved this from In progress to Done for v9.2.x in 9.2.x Branch and Release Oct 14, 2025
@zwoop zwoop removed this from the 10.2.0 milestone Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

TrafficServer 9.2.x fails to cache 200 responses after 302 redirects despite valid caching headers

8 participants