HTTP/2 stream VIOs are read and updated without the VIO mutex
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 42/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- cpp
- Ambito
- networking
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- C++
- Stelle
- 2k
- Fork
- 903
- Merge medio
- 4g 4h
- PR unite (30g)
- 135
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/trafficserver
-
UnixNetVConnection::do_io_write with a null reader leaves the previous reader in the write VIOForse già presa @NginxL l’ha presa oggi. ApertaBug Good First Issue IOBuffer Network
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/trafficserver#14220 ·
I maintainer di solito rispondono entro 2 giorni
-
MallocAllocator does not check for allocation failureForse già presa @umrndem l’ha presa oggi. ApertaBug Core Good First Issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/trafficserver#14218 · 2 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
Bug Event System Threads
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/trafficserver#14217 ·
I maintainer di solito rispondono entro 2 giorni
-
TSContScheduleEveryOnPool and TSContScheduleEveryOnThread accept a zero or negative periodForse già presa @rajeetvk l’ha presa 1 giorno fa. ApertaBug Event System Good First Issue TS API
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
apache/trafficserver#14214 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
HostDBContinuation::init memsets a polymorphic ActionForse già presa @ANMOLSCRIPT l’ha presa oggi. ApertaBug Good First Issue HostDB
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
apache/trafficserver#14204 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di apache/trafficserver
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
I maintainer di solito rispondono entro 2 giorni
-
bug data-types
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
ClickHouse/clickhouse-cpp#645 ·
I maintainer di solito rispondono entro 1 giorno
-
bug compatibility difficulty:easy prio:normal
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
NatronGitHub/openfx-misc#524 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation enhancement help wanted P0
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Awesome-Embedded-Learning-Studio/Tutorial_AwesomeModernCPP#359 ·
I maintainer di solito rispondono entro 1 giorno
-
Type: Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
openscad/openscad#7360 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno