Skip to content

Remove unused member variables across multiple subsystems#13005

Open
bryancall wants to merge 1 commit intoapache:masterfrom
bryancall:remove-unused-member-variables
Open

Remove unused member variables across multiple subsystems#13005
bryancall wants to merge 1 commit intoapache:masterfrom
bryancall:remove-unused-member-variables

Conversation

@bryancall
Copy link
Contributor

@bryancall bryancall commented Mar 20, 2026

Summary

Remove unused member variables and dead code identified by static analysis across core, cache, net, proxy, and plugin subsystems.

Changes

  • Event.h: Remove permanently dead #ifdef ONLY_USED_FOR_FIB_AND_BIN_HEAP block (node_pointer, set_node_pointer, get_node_pointer)
  • HttpSM.h/cc: Remove unused _postbuf, is_redirect, piggybacking_scheduled, and simplify redirection_tries initialization
  • CacheVC.h: Reorder member field alignment, rename unused open_read_timeout to unused_open_read_timeout for clarity
  • CacheDir.cc: Remove write to unused f.open_read_timeout flag
  • AIO.h/ink_aiocb.h/AIO.cc: Remove unused aio_state field, aio__pad[1], and index bookkeeping. The aio_state and padding were cargo-culted from the POSIX struct aiocb definition when ink_aiocb was created. POSIX implementations include padding for future ABI compatibility, but ink_aiocb is entirely internal to ATS — never shared across a binary interface or persisted to disk. Nothing reads or writes aio_state. Leif removed the other dead POSIX fields (aio_reqprio, aio_sigevent, aio_resultp) in 2019 (e439818) but these two survived the cleanup.
  • LogBuffer.h: Remove unused m_new_buffer_event_id field, simplify LogBufferIterator constructor
  • Http1ClientTransaction.h / Http1ServerTransaction.h: Remove unused outbound_port and outbound_transparent fields
  • ConnectingEntry.h: Remove unused mutex field
  • ParentConsistentHash.h/cc: Remove unused chash local and foundParents member
  • P_SSLNetVConnection.h: Remove unused protocol_mask_set and protocol_mask fields from SSLNetVConnection (note: the protocol_mask in TLSValidProtocols used by SNI configuration is a different field on a different class and is not affected)

Testing

Tested on Eris (home lab, Fedora, ASAN build):

  • Build: Clean compile (844 targets dev-asan, 1431 targets autest preset)
  • Unit tests: 110/110 passed
  • Autests: 390 passed, 9 failed (all known flaky: tls_conn_timeout, tls_client_versions, thread_config, cripts, allow-plain, sigusr2, per_client_connection_max), 30 skipped

Remove unused member variables and dead code identified by static
analysis across core, cache, net, proxy, and plugin subsystems.

Changes include removing unreferenced fields from Event, HttpSM,
CacheVC, AIO, LogBuffer, ConnectingEntry, Http1 transactions,
ParentConsistentHash, and SSLNetVConnection. Also removes a
permanently dead #ifdef ONLY_USED_FOR_FIB_AND_BIN_HEAP block
from Event.h.
Copy link
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

Removes unused member variables, flags, and dead code paths across several ATS subsystems (HTTP state machine, cache, AIO, logging, net), primarily as static-analysis-driven cleanup to reduce maintenance surface area.

Changes:

  • Removes unused fields/flags from key classes/structs (HttpSM, CacheVC, AIO, transactions, SSLNetVConnection, ConnectingEntry).
  • Deletes dead code blocks/initializations and simplifies a few initialization paths (e.g., Event.h dead #ifdef, ParentConsistentHash ctor, HttpSM callout reset).
  • Adjusts small API surfaces to drop unused parameters/state (e.g., LogBufferIterator ctor signature).

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/proxy/http/HttpSM.cc Stops resetting removed/unused hook-tracking state during API callout init.
include/proxy/http/HttpSM.h Removes unused state members and tightens member declarations around callout/state transitions.
src/proxy/ParentConsistentHash.cc Removes now-unused initialization related to removed bookkeeping members.
include/proxy/ParentConsistentHash.h Drops unused foundParents storage from the strategy object.
src/iocore/net/P_SSLNetVConnection.h Removes unused TLS protocol mask state from SSLNetVConnection.
src/iocore/cache/CacheVC.h Updates CacheVC flag bitfield layout, including reserving an unused bit.
src/iocore/cache/CacheDir.cc Removes writes to an unused CacheVC flag bit.
src/iocore/aio/AIO.cc Removes unused request bookkeeping (index) and related initialization.
include/iocore/aio/AIO.h Removes unused ink_aiocb/AIOCallback fields from the public AIO header.
include/tscore/ink_aiocb.h Removes unused fields/padding from the legacy ink_aiocb definition.
include/proxy/logging/LogBuffer.h Simplifies LogBufferIterator construction by removing unused network-order state.
include/proxy/http/Http1ServerTransaction.h Removes unused outbound transparency flag from the transaction type.
include/proxy/http/Http1ClientTransaction.h Removes unused outbound transparency flag from the transaction type.
include/proxy/http/ConnectingEntry.h Removes unused NetVCOptions member from ConnectingEntry.
include/iocore/eventsystem/Event.h Deletes a permanently-dead #ifdef block related to heap node pointers.

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.

2 participants