Skip to content

Clean up dead config records in NetHandler #12933

@brbzull0

Description

@brbzull0

While doing some other work I found out that some records in the nethandler are dead. Asked Claude to investigate and came up with the following


Three proxy.config.net.* records in NetHandler have been dead code since their introduction in 2015 (TS-3313, commit 974e8e3). They were never registered in RecordsConfig.cc, are not documented, and the config values they store are never consumed by any functional code.

Affected records

Record Registered in RecordsConfig.cc? Read by any logic?
proxy.config.net.inactive_threshold_in ❌ No ❌ No
proxy.config.net.transaction_no_activity_timeout_in ❌ No ❌ No
proxy.config.net.keep_alive_no_activity_timeout_in ❌ No ❌ No

What exists today

Each record has plumbing that compiles and is structurally reachable, but is dead in practice:

  1. Config struct fields in NetHandler.h L116-L118 — defined but never read by any functional code.

  2. RecGetRecordInt() reads in NetHandler.cc L180-L184 — always return 0 via value_or(0) since the records don't exist in RecordsConfig.cc.

  3. RecRegisterConfigUpdateCb() callbacks in NetHandler.cc L201-L203 — register callbacks on non-existent records, so they can never fire.

  4. Handler branches in NetHandler.cc L131-L139 — would write to the config fields if the callbacks fired, but they can't (see point 3), and even if they could, no code reads the stored values.

  5. Debug log lines in NetHandler.cc L210-L214 — always log 0.

History

  • 2015 — TS-3313 (974e8e3): Introduced all three records (with inactive_threashold_in typo) in UnixNet.cc with REC_ReadConfigInt32() and RecRegisterConfigUpdateCb(), but forgot to add them to RecordsConfig.cc. Only max_connections_in and max_connections_active_in were added to the config table.
  • 201769343fe: Refactored NetHandler init to be static. Fixed typo inactive_threashold_ininactive_threshold_in. Carried forward the same unregistered records.
  • Present — Records remain unregistered and unused.

Not related to the http variants

There are similarly-named records in the HTTP layer that are properly registered and functional:

These are separate records serving different purposes in the HTTP layer — no replacement or renaming occurred.

Proposed fix

Remove the dead plumbing for all three records:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions