Remove unused member variables across multiple subsystems#13005
Open
bryancall wants to merge 1 commit intoapache:masterfrom
Open
Remove unused member variables across multiple subsystems#13005bryancall wants to merge 1 commit intoapache:masterfrom
bryancall wants to merge 1 commit intoapache:masterfrom
Conversation
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.
Contributor
There was a problem hiding this comment.
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. |
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.
Summary
Remove unused member variables and dead code identified by static analysis across core, cache, net, proxy, and plugin subsystems.
Changes
#ifdef ONLY_USED_FOR_FIB_AND_BIN_HEAPblock (node_pointer,set_node_pointer,get_node_pointer)_postbuf,is_redirect,piggybacking_scheduled, and simplifyredirection_triesinitializationopen_read_timeouttounused_open_read_timeoutfor clarityf.open_read_timeoutflagaio_statefield,aio__pad[1], andindexbookkeeping. Theaio_stateand padding were cargo-culted from the POSIXstruct aiocbdefinition whenink_aiocbwas created. POSIX implementations include padding for future ABI compatibility, butink_aiocbis entirely internal to ATS — never shared across a binary interface or persisted to disk. Nothing reads or writesaio_state. Leif removed the other dead POSIX fields (aio_reqprio,aio_sigevent,aio_resultp) in 2019 (e439818) but these two survived the cleanup.m_new_buffer_event_idfield, simplifyLogBufferIteratorconstructoroutbound_portandoutbound_transparentfieldsmutexfieldchashlocal andfoundParentsmemberprotocol_mask_setandprotocol_maskfields fromSSLNetVConnection(note: theprotocol_maskinTLSValidProtocolsused by SNI configuration is a different field on a different class and is not affected)Testing
Tested on Eris (home lab, Fedora, ASAN build):
tls_conn_timeout,tls_client_versions,thread_config,cripts,allow-plain,sigusr2,per_client_connection_max), 30 skipped