traffic_server ignores -n / --net_threads / PROXY_NET_THREADS

未关闭 适合新手
#14,200 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
cpp
领域
networking

调研方向

阅读 src/traffic_server/traffic_server.cc 中的 process_args 和 main 内的赋值,然后检查 doc/appendices/command-line/traffic_server.en.rst 中关于 -n 和 --net_threads 的文档。验证显式提供的线程数在参数解析后仍然保留,并在自动配置路径中传递给 adjust_num_of_net_threads;当该选项和 PROXY_NET_THREADS 按文档所述工作,或在计划弃用时连同其文档一起删除,任务即告完成。

由索引模型根据 Issue 内容生成。

描述

Bug Configuration Core Regression Startup

traffic_server still accepts -n COUNT / --net_threads COUNT and the PROXY_NET_THREADS environment variable (https://github.com/apache/trafficserver/blob/eeeada36e1dff81822977bc36016d4264d64cdb8/src/traffic_server/traffic_server.cc#L227, documented in https://github.com/apache/trafficserver/blob/eeeada36e1dff81822977bc36016d4264d64cdb8/doc/appendices/command-line/traffic_server.en.rst#L120). process_args stores the value in num_of_net_threads (https://github.com/apache/trafficserver/blob/eeeada36e1dff81822977bc36016d4264d64cdb8/src/traffic_server/traffic_server.cc#L2033), but main later overwrites it unconditionally with the processor count before passing it to adjust_num_of_net_threads (https://github.com/apache/trafficserver/blob/eeeada36e1dff81822977bc36016d4264d64cdb8/src/traffic_server/traffic_server.cc#L2290-L2292).

Before #12023 ("Verbose debugging for setting the number of net threads"), num_of_net_threads was initialized to ink_number_of_processors() at its definition, so the option overrode it, and with proxy.config.exec_thread.autoconfig.enabled: 1 (the default) adjust_num_of_net_threads scaled the given value. #12023 moved the processor-count assignment to after argument parsing, so the option has had no effect since. This looks unintended for a debug-logging change.

With autoconfig disabled, proxy.config.exec_thread.limit decides the count either way, so only the autoconfig path is affected.

Suggested fix: assign ink_number_of_processors() only when the option was not given (for example, keep the 0 default and treat 0 as "not set"), or remove the option and its documentation if it's meant to be gone.


generated with Claude Opus 5.5 by Josiah VanderZee

主要语言
C++
星标
2k
派生
903
平均合并
4 天 4 小时
30 天内合并 PR
135

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/trafficserver 的其他 Issue

查看 apache/trafficserver 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。