Skip to content

Remove cache alternate vector detach#13138

Merged
bneradt merged 1 commit into
apache:masterfrom
bneradt:remove-cache-http-detach
May 12, 2026
Merged

Remove cache alternate vector detach#13138
bneradt merged 1 commit into
apache: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.

@bneradt bneradt merged commit 5f6a83d into apache:master May 12, 2026
19 checks passed
@bneradt bneradt deleted the remove-cache-http-detach branch May 12, 2026 15:54
@github-project-automation github-project-automation Bot moved this to For v10.2.0 in ATS v10.2.x May 12, 2026
@ezelkow1
Copy link
Copy Markdown
Member

Can you also make a 9.2.x pr since i guess this isnt going in sec

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

Projects

Status: For v10.2.0

Development

Successfully merging this pull request may close these issues.

4 participants