Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stale negative responses returned under unknown conditions #12029

Open
vuori opened this issue Feb 11, 2025 · 2 comments
Open

Stale negative responses returned under unknown conditions #12029

vuori opened this issue Feb 11, 2025 · 2 comments
Assignees
Labels

Comments

@vuori
Copy link

vuori commented Feb 11, 2025

I have been seeing stale negative getting stuck in cache on ATS 10.0.2 and 10.0.3, but have been unable to reproduce this under controlled conditions. The problem has only been seen under relatively high loads, but it might be that the issue occurs more often if the response is cached due to an internal request (from a Lua fetch call). Whatever the cause, the cached negative response is returned for all requests. Usually the cached response disappears after restarting ATS.

Sample response:

< HTTP/1.1 400 Bad Request
< Cache-Control: public; max-age=30
< Date: Mon, 10 Feb 2025 11:40:36 GMT
< Content-Length: 0
< Age: 866

This is a relatively short-lived instance, sometimes the times go up to tens of hours for such response.

The negative caching here is prompted only by the Cache-Control header. There are no cache.config pins for the origin so this shouldn't be #11854 and negative_caching_enabled is set to 0. The above response was from a forward-proxied request with no remap entry, but the problem also occurs for remapped reverse-proxy requests.

I have unfortunately not been able to gather debug logs for this, since it has only been seen on busy servers and seems to depend on in-memory state.

@vuori
Copy link
Author

vuori commented Feb 11, 2025

I just noticed that the service suffering from the problem was returning a Cache-Control with an invalid separator (; instead of ,). With a synthetic test, I can reproduce the error-is-cached-forever behavior when sending a similar malformed C-C.

The fact that this C-C gets parsed to mean "cache this forever" seem like an unexpected result?

@bneradt
Copy link
Contributor

bneradt commented Feb 24, 2025

Thank you for your observations. It would be good to add autests for this. @cmcfarlen or I intend to do this at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants