-
Notifications
You must be signed in to change notification settings - Fork 852
Add fixes around fail_action 5 #12845
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
Conversation
add fixes around read_retry write fail action 5
|
[approve ci autest] |
tests/gold_tests/cache/replay/cache-read-retry-basic.replay.yaml
Outdated
Show resolved
Hide resolved
tests/gold_tests/cache/replay/cache-read-retry-basic.replay.yaml
Outdated
Show resolved
Hide resolved
tests/gold_tests/cache/replay/cache-read-retry-basic.replay.yaml
Outdated
Show resolved
Hide resolved
tests/gold_tests/cache/replay/cache-read-retry-exhausted.replay.yaml
Outdated
Show resolved
Hide resolved
tests/gold_tests/cache/replay/cache-read-retry-exhausted.replay.yaml
Outdated
Show resolved
Hide resolved
tests/gold_tests/cache/replay/cache-read-retry-exhausted.replay.yaml
Outdated
Show resolved
Hide resolved
tests/gold_tests/cache/replay/cache-read-retry-exhausted.replay.yaml
Outdated
Show resolved
Hide resolved
tests/gold_tests/cache/replay/cache-read-retry-exhausted.replay.yaml
Outdated
Show resolved
Hide resolved
tests/gold_tests/cache/replay/cache-read-retry-exhausted.replay.yaml
Outdated
Show resolved
Hide resolved
tests/gold_tests/cache/replay/cache-read-retry-exhausted.replay.yaml
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds fixes for cache fail_action 5 (READ_RETRY mode) to prevent infinite looping scenarios and handle redirect edge cases correctly.
Changes:
- Prevents looping when read retries are exhausted by bypassing cache instead of attempting another write lock
- Adds defensive check for redirect scenarios with
redirect_use_orig_cache_keyenabled - Adds comprehensive autotests to verify READ_RETRY mode stability and request collapsing
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/proxy/http/HttpTransact.cc | Adds two checks to prevent looping in READ_RETRY state: one in HandleCacheOpenReadMiss and a defensive check in set_cache_prepare_write_action_for_new_request for redirect scenarios |
| tests/gold_tests/cache/replay/cache-read-retry.replay.yaml | New test file that validates READ_RETRY mode with concurrent requests, slow origin responses, and verifies request collapsing and system stability |
| tests/gold_tests/cache/cache-read-retry-mode.test.py | Test runner for the READ_RETRY mode test |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This adds some fixes around fail_action 5. First it prevents a possible looping scenario, previously after exhausting waiting for a read lock after having failed in a write lock it would loop back around to check for write again. Now it will just go to origin. While this allows an extra request through it can prevent some odd scenarios, including one where it just writes back to the cache again anyway which would already be useless. Also if the original rww request is very slow then this allows waiters to bypass it.
Second there could be an issue around redirects, normally a redirect is fine since it would have a different cachekey but if we enable use_orig then we could end up in the same looping contention in that scenario as well.
Also adds some autests, though we should keep an eye on these since they could be timing dependent. So if we start getting failures we can turn them off.