Skip to content

Conversation

@bneradt
Copy link
Contributor

@bneradt bneradt commented Nov 23, 2025

When negative revalidating was enabled, zero-length cached objects would
fail on the second consecutive stale request with a 5xx response from
the origin. The first stale request would correctly serve the cached
content, but the second would return the origin's error response
instead. This occurred because the cache attempted to read additional
fragments for zero-length documents when the cache key didn't match the
document key, causing a cache read failure (ECACHE_NO_DOC). The fix
ensures zero-length documents are always treated as single-fragment,
preventing attempts to read non-existent body data.

Fixes: #6649

@bneradt bneradt added this to the 10.2.0 milestone Nov 23, 2025
@bneradt bneradt requested a review from ezelkow1 November 23, 2025 05:09
@bneradt bneradt self-assigned this Nov 23, 2025
ezelkow1
ezelkow1 previously approved these changes Nov 23, 2025
When negative revalidating was enabled, zero-length cached objects would
fail on the second consecutive stale request with a 5xx response from
the origin. The first stale request would correctly serve the cached
content, but the second would return the origin's error response
instead. This occurred because the cache attempted to read additional
fragments for zero-length documents when the cache key didn't match the
document key, causing a cache read failure (ECACHE_NO_DOC). The fix
ensures zero-length documents are always treated as single-fragment,
preventing attempts to read non-existent body data.

Fixes: apache#6649
@bneradt bneradt merged commit 20b4cb2 into apache:master Nov 24, 2025
15 checks passed
@bneradt bneradt deleted the fix_negative_revalidating branch November 24, 2025 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Negative revalidating lifetime not fully respected, appears only valid on first stale request

2 participants