Remove cache alternate vector detach#13138
Open
bneradt wants to merge 1 commit intoapache:masterfrom
Open
Conversation
Cache alternate detach is a private helper with no current callers, and its compaction loop contains a latent out-of-bounds read if the helper is ever used. Keeping the dead path around preserves a future cache metadata hazard without providing any current behavior. This removes the unused helper and its declaration instead of repairing the unreachable implementation. Existing alternate removal continues to use the live remove path.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the unused CacheHTTPInfoVector::detach() helper from the cache HTTP alternate vector implementation. The removed code path was dead (no callers) and contained a latent out-of-bounds read risk due to incorrect compaction logic, so deleting it reduces future maintenance and safety hazards without changing current behavior.
Changes:
- Removed the
CacheHTTPInfoVector::detach(int idx, CacheHTTPInfo *r)declaration fromP_CacheHttp.h. - Removed the unused
CacheHTTPInfoVector::detach()implementation fromCacheHttp.cc.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/iocore/cache/P_CacheHttp.h | Drops the unused detach() method declaration from the internal cache alternate vector API. |
| src/iocore/cache/CacheHttp.cc | Deletes the dead detach() implementation (including the buggy compaction loop), leaving the existing remove() path as the sole alternate-removal mechanism. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cache alternate detach is a private helper with no current callers, and
its compaction loop contains a latent out-of-bounds read if the helper is
ever used. Keeping the dead path around preserves a future cache metadata
hazard without providing any current behavior.
This removes the unused helper and its declaration instead of repairing
the unreachable implementation. Existing alternate removal continues to
use the live remove path.