Skip to content

Remove cache alternate vector detach#13138

Open
bneradt wants to merge 1 commit intoapache:masterfrom
bneradt:remove-cache-http-detach
Open

Remove cache alternate vector detach#13138
bneradt wants to merge 1 commit intoapache:masterfrom
bneradt:remove-cache-http-detach

Conversation

@bneradt
Copy link
Copy Markdown
Contributor

@bneradt bneradt commented May 5, 2026

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.

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.
@bneradt bneradt added this to the 11.0.0 milestone May 5, 2026
@bneradt bneradt self-assigned this May 5, 2026
@bneradt bneradt requested a review from Copilot May 5, 2026 22:20
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 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 from P_CacheHttp.h.
  • Removed the unused CacheHTTPInfoVector::detach() implementation from CacheHttp.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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants