Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Every client accept takes the connection tracker locks

Aperta
#13,890 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
42/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
cpp

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Network Performance

Every TCP client accept takes two locks in ConnectionTracker, whatever the configuration:

  1. The shared lock on the client exempt list (client_exempt_list_mutex), in ConnectionTracker::is_client_exempt(). The accept takes it even when proxy.config.http.per_client.connection.exempt_list is empty.
  2. For a client that is not in the exempt list, the exclusive mutex on the inbound table (_inbound_table._mutex), in ConnectionTracker::obtain_inbound(). The accept finds or creates a Group for the client address. When the last connection from that address closes, Group::release() takes the same mutex again to erase the Group.

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_in is 0. The get_connection_tracker_info JSONRPC 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_in and proxy.process.net.per_client.connections_exempt_currently_open would then count only the connections that a limit applied to.

The cost of these locks has not been measured.

Lingua principale
C++
Stelle
2k
Fork
882
Merge medio
3g 19h
PR unite (30g)
113

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/trafficserver

Tutte le issue di apache/trafficserver

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.