Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Every client accept takes the connection tracker locks

Abierto
#13,890 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
42/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
cpp

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
C++
Estrellas
2k
Forks
882
Merge medio
3 d 19 h
PR fusionados (30 d)
113

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de apache/trafficserver

Todos los issues de apache/trafficserver

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.