-
Notifications
You must be signed in to change notification settings - Fork 853
Add autest to cover updates to cache with alternates #8779
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
|
When digging into this issue, it appears to stem from setting a CacheVC instance variable called Later in the transaction, when a response with a Because we are already reading the |
bneradt
left a comment
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.
The test looks good. Thanks for adding a regression test for this.
tests/gold_tests/cache/replay/alternate-caching-update-size.yaml
Outdated
Show resolved
Hide resolved
|
Looks like this is causing the alternate-caching Au test to fail. |
|
Yes, this PR is just an autest that demonstrates the bug with alternate cache updates so that people could reason about it. A fix is forthcoming and then this autest will pass. |
|
Looks good. |
bneradt
left a comment
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.
Looks good to me.
|
Merging this PR on behalf of @cmcfarlen due to the approval from @bneradt and my own knowledge of how this works. |
|
Cherry-picked to v9.2.x |
* Add autest to cover updates to cache with alternates * remove trailing line(autopep8) * add comments describing the requests * reduce delay and max-age on test * set cache object size to zero when incoming content length is zero * add demystifying comment Co-authored-by: Chris McFarlen <cmcfarlen@apple.com> (cherry picked from commit 4c5b182)
|
We faced another symptom made by this bug. If the half-updated object is big enough (> 1GB) and it's on the RAM Cache, you might see the below crash made by a huge loop on cache read. ( the number of call stack is over 8000 ) |
…pache#356) * Add autest to cover updates to cache with alternates * remove trailing line(autopep8) * add comments describing the requests * reduce delay and max-age on test * set cache object size to zero when incoming content length is zero * add demystifying comment Co-authored-by: Chris McFarlen <cmcfarlen@apple.com> (cherry picked from commit 4c5b182) Co-authored-by: Chris McFarlen <chris@mcfarlen.us>
* asf/9.2.x: Updated ChangeLog Fix parent_select optional scheme (apache#8831) Add `#pragma once` for PendingAction.h (apache#8846) Promote class PendingAction from HttpSM.h for use in other classes. (apache#8423) Fixes leak in SNIAction name globbing (apache#8827) Handle opentelemetry-cpp v1.3.0 upgrade for otel_tracer plugin (apache#8834) Fix overflow conditions in prefetch plugin (apache#8660) Remove incorrect comment from base64 functions (apache#8835) Add autest to cover updates to cache with alternates (apache#8779)
This autest demonstrates an issue with cache alternates and updating from a response with a content-length to one with content-length 0.
When an alternate is replaced, and previously had a content-length, there is a bug where then old content is preserved and only this headers are changed (and the new 0-length content is not "written"). When this half-updated asset is served from cache, the content length is mismatched, delivered via chunked encoding and the old contents are shipped to the client.