Every client accept takes the connection tracker locks
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 42/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- cpp
- 領域
- backend, performance
調査の方向性
Start by reading ConnectionTracker::is_client_exempt(), ConnectionTracker::obtain_inbound(), Group::release(), and handle_max_client_connections() to trace the accept and close paths. The issue lists several possible changes but gives no measured lock cost or chosen behavior; first measure the contention and assess how skipping table lookups affects get_connection_tracker_info and the exempt connection counters.
索引モデルが issue の本文から書いたものです。
説明
Every TCP client accept takes two locks in ConnectionTracker, whatever the configuration:
- The shared lock on the client exempt list (
client_exempt_list_mutex), inConnectionTracker::is_client_exempt(). The accept takes it even whenproxy.config.http.per_client.connection.exempt_listis empty. - For a client that is not in the exempt list, the exclusive mutex on the inbound table (
_inbound_table._mutex), inConnectionTracker::obtain_inbound(). The accept finds or creates aGroupfor the client address. When the last connection from that address closes,Group::release()takes the same mutex again to erase theGroup.
The accept takes the second lock even when proxy.config.net.per_client.max_connections_in is 0, which means no limit. NetHandler::get_per_client_max_connections_in() maps 0 to INT32_MAX - 1, so the client_max > 0 check in handle_max_client_connections() always passes. This has been the case since #10688. #13737 kept the same locks for accepted connections. Connections that proxy.config.net.connections_throttle refuses now also take the shared lock, because the exempt-list lookup happens before the throttle check.
The inbound table mutex is one mutex for all accept threads. A client that opens one connection at a time takes it twice per connection and allocates a new Group each time.
Possible changes:
- Skip the inbound table when
max_connections_inis 0. Theget_connection_tracker_infoJSONRPC method reports the inbound table, so with no limit set, clients would no longer appear in its output. - Skip the exempt-list lock when the list is empty, or keep the list as an immutable snapshot that a reload or a plugin API edit replaces, so that readers take no lock.
- Together with the first change, look up the exempt list only when the per-client limit is set or the connection count is at
connections_throttle.proxy.process.net.per_client.connections_exempt_inandproxy.process.net.per_client.connections_exempt_currently_openwould then count only the connections that a limit applied to.
The cost of these locks has not been measured.
- 主要言語
- C++
- スター
- 2k
- フォーク
- 882
- 平均マージ
- 3日 19時間
- マージ済み PR(30日)
- 113
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/trafficserver のほかの issue
-
Bug Metrics
難易度 3/5 1〜2日 初心者へのやさしさ 74/100
apache/trafficserver#13940 ·
メンテナーはふだん 2 日以内に返信
-
WebSocket upgrade to an HTTP/2 origin is sent as a plain GET対応中かも @bryancall が 3 日前に担当しました。 オープンBug HTTP/2 Websockets
apache/trafficserver#13920 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
Branch build clones: mirror stalls, clone timeout and controller memory対応中かも @bryancall が 15 日前に担当しました。 オープンCI
apache/trafficserver#13839 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
traffic_ctl: apply --error-level to config reload results対応中かも @brbzull0 が 17 日前に担当しました。 オープンtraffic_ctl
apache/trafficserver#13832 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
header_rewrite: rm-destination after set-destination URL crashes traffic_server対応中かも @moonchen が 24 日前に担当しました。 オープンBug Crash header_rewrite Plugins
apache/trafficserver#13800 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
apache/trafficserver の issue をすべて見る
似ている issue
-
good first issue invalid
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
DanielJerolm/gpcc#74 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
patrick-hudson/put.gd-desktop#808 ·
メンテナーはふだん 1 日以内に返信
-
DPI change is not fully handled in the cascading window on Windows対応中かも @yukawa が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
dasher-project/Dasher-GTK#97 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信