HTTP/2 stream VIOs are read and updated without the VIO mutex
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 42/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- cpp
- Lĩnh vực
- networking
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- C++
- Star
- 2k
- Fork
- 903
- Merge trung bình
- 4 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 135
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/trafficserver
-
UnixNetVConnection::do_io_write with a null reader leaves the previous reader in the write VIOCó thể đã có người làm @NginxL đã nhận hôm nay. Đang mởBug Good First Issue IOBuffer Network
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/trafficserver#14220 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
MallocAllocator does not check for allocation failureCó thể đã có người làm @umrndem đã nhận hôm nay. Đang mởBug Core Good First Issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/trafficserver#14218 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
THREAD_ALLOC dereferences a null thread while THREAD_FREE falls back to the global allocatorĐang mởBug Event System Threads
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/trafficserver#14217 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
TSContScheduleEveryOnPool and TSContScheduleEveryOnThread accept a zero or negative periodCó thể đã có người làm @rajeetvk đã nhận 1 ngày trước. Đang mởBug Event System Good First Issue TS API
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
apache/trafficserver#14214 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
HostDBContinuation::init memsets a polymorphic ActionCó thể đã có người làm @ANMOLSCRIPT đã nhận hôm nay. Đang mởBug Good First Issue HostDB
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
apache/trafficserver#14204 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của apache/trafficserver
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
Maintainer thường phản hồi trong vòng 2 ngày
-
bug data-types
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
ClickHouse/clickhouse-cpp#645 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug compatibility difficulty:easy prio:normal
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
NatronGitHub/openfx-misc#524 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[内容提案] 现在C++模块的CMake支持有更新,需要进行同步Đang mởdocumentation enhancement help wanted P0
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Awesome-Embedded-Learning-Studio/Tutorial_AwesomeModernCPP#359 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Type: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
openscad/openscad#7360 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày