HTTP/2 stream VIOs are read and updated without the VIO mutex
Les mainteneurs répondent en général sous 2 jours
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 42/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- Active
- Stack technique
- cpp
- Domaine
- networking
Piste de recherche
Read the cited paths in src/proxy/http2/Http2ConnectionState.cc and src/proxy/http2/Http2Stream.cc, along with include/proxy/http2/Http2Stream.h, then trace the VIO mutex and session-thread affinity through src/proxy/http/HttpSM.cc. Determine whether to lock VIO accesses or document and assert the single-thread invariant; done means the chosen invariant is enforced consistently for the listed read and signal paths.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Several HTTP/2 paths touch a stream's read_vio/write_vio while holding only the session mutex, or no lock at all. The consumer (HttpSM) modifies the same VIOs while holding the VIO mutex, which is the stream's own mutex (Http2ConnectionState.cc#L1992). HttpSM::attach_client_session adopts it as the SM mutex (HttpSM.cc#L440).
Http2ConnectionState::rcv_data_frame(Http2ConnectionState.cc#L101) writes into the read VIO's buffer and advancesread_vio.ndoneandread_vio.nbytesthroughupdate_read_length/set_read_done(Http2ConnectionState.cc#L269-L274, Http2Stream.h#L572-L582). It takes no stream or VIO lock.Http2ConnectionState::restart_receivingreads the read VIO's buffer throughread_vio_read_avail()under the session mutex only (Http2ConnectionState.cc#L2238).Http2Stream::signal_read_eventandsignal_write_eventreadread_vio.cont,cont->mutex,opand the disabled flag before taking any lock. They then lockcont->mutex, notvio.mutex(Http2Stream.cc#L942-L951, Http2Stream.cc#L989-L999).
The send path does take stream->mutex before update_sent_count (Http2ConnectionState.cc#L2559).
As far as I can tell, this is not a live data race today. The stream's consumer runs on the session's thread: HttpSM sets its thread affinity in init, TSHttpTxnReenable reschedules onto that affinity, and multiplexed origin sessions are pooled per thread. So the writer and the readers are serialized by running on one EThread rather than by a lock. That invariant isn't stated or checked anywhere. If a consumer of a stream VIO ever runs on a different thread (a plugin, a future change to the session pools), these accesses become data races on ndone, nbytes, cont and the buffer.
Suggested fix: either hold the VIO mutex (the stream mutex) for these accesses, or document the single-thread invariant and add a debug assertion that the stream is only touched from the session's thread.
generated with Claude Opus 5.5 by Josiah VanderZee
- Langage dominant
- C++
- Étoiles
- 2k
- Forks
- 903
- Merge moyen
- 4 j 4 h
- PR mergées (30 j)
- 135
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de apache/trafficserver
-
UnixNetVConnection::do_io_write with a null reader leaves the previous reader in the write VIOPeut-être pris @NginxL l’a pris aujourd’hui. OuverteBug Good First Issue IOBuffer Network
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
apache/trafficserver#14220 ·
Les mainteneurs répondent en général sous 2 jours
-
MallocAllocator does not check for allocation failurePeut-être pris @umrndem l’a pris aujourd’hui. OuverteBug Core Good First Issue
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
apache/trafficserver#14218 · 2 commentaires ·
Les mainteneurs répondent en général sous 2 jours
-
THREAD_ALLOC dereferences a null thread while THREAD_FREE falls back to the global allocatorOuverteBug Event System Threads
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
apache/trafficserver#14217 ·
Les mainteneurs répondent en général sous 2 jours
-
TSContScheduleEveryOnPool and TSContScheduleEveryOnThread accept a zero or negative periodPeut-être pris @rajeetvk l’a pris il y a 1 jour. OuverteBug Event System Good First Issue TS API
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
apache/trafficserver#14214 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours
-
HostDBContinuation::init memsets a polymorphic ActionPeut-être pris @ANMOLSCRIPT l’a pris aujourd’hui. OuverteBug Good First Issue HostDB
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
apache/trafficserver#14204 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours
Toutes les issues de apache/trafficserver
Issues similaires
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
Les mainteneurs répondent en général sous 2 jours
-
bug data-types
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
ClickHouse/clickhouse-cpp#645 ·
Les mainteneurs répondent en général sous 1 jour
-
bug compatibility difficulty:easy prio:normal
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
NatronGitHub/openfx-misc#524 ·
Les mainteneurs répondent en général sous 1 jour
-
[内容提案] 现在C++模块的CMake支持有更新,需要进行同步Ouvertedocumentation enhancement help wanted P0
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
Awesome-Embedded-Learning-Studio/Tutorial_AwesomeModernCPP#359 ·
Les mainteneurs répondent en général sous 1 jour
-
Type: Bug
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
openscad/openscad#7360 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour