Every client accept takes the connection tracker locks
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
- Área
- backend, performance
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
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.
- Lenguaje dominante
- C++
- Estrellas
- 2k
- Forks
- 882
- Merge medio
- 3 d 19 h
- PR fusionados (30 d)
- 113
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/trafficserver
-
Bug Metrics
Dificultad 3/5 1-2 días Aptitud para principiantes 74/100
apache/trafficserver#13940 ·
Los mantenedores suelen responder en 2 días
-
WebSocket upgrade to an HTTP/2 origin is sent as a plain GETPosiblemente ocupada @bryancall la tomó hace 3 días. AbiertoBug HTTP/2 Websockets
apache/trafficserver#13920 · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
Branch build clones: mirror stalls, clone timeout and controller memoryPosiblemente ocupada @bryancall la tomó hace 15 días. AbiertoCI
apache/trafficserver#13839 · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
traffic_ctl: apply --error-level to config reload resultsPosiblemente ocupada @brbzull0 la tomó hace 17 días. Abiertotraffic_ctl
apache/trafficserver#13832 · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
header_rewrite: rm-destination after set-destination URL crashes traffic_serverPosiblemente ocupada @moonchen la tomó hace 24 días. AbiertoBug Crash header_rewrite Plugins
apache/trafficserver#13800 · 1 asignado ·
Los mantenedores suelen responder en 2 días
Todos los issues de apache/trafficserver
Issues similares
-
good first issue invalid
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
DanielJerolm/gpcc#74 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
patrick-hudson/put.gd-desktop#808 ·
Los mantenedores suelen responder en 1 día
-
DPI change is not fully handled in the cascading window on WindowsPosiblemente ocupada @yukawa la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 4 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
dasher-project/Dasher-GTK#97 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día