Data race on Action::cancelled
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
- 53/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- cpp
- Lĩnh vực
- backend, distributed-systems
Hướng nghiên cứu
Start by reading include/iocore/eventsystem/Action.h and the listed readers in UnixEThread.cc, ProtectedQueue.cc, PQ-List.cc, DNS.cc, and HostDB.cc to understand how cancellation is synchronized across threads. The issue proposes making cancelled an atomic boolean with acquire/release ordering. Done means addressing the reported unsynchronized accesses and writes, then verifying the relevant event, DNS, and HostDB paths.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Action::cancelled is a plain bool (Action.h#L94). Action::cancel() writes it, and the class requires the caller to hold Action::mutex (Action.h#L51, #L159-L164). Several readers check it on another thread without holding that mutex:
- The EThread dispatcher, before it try-locks the Event's mutex: UnixEThread.cc#L213 (external queue) and UnixEThread.cc#L331 (priority queue).
- ProtectedQueue.cc#L77 in
dequeue_external(), which frees cancelled Events. - PQ-List.cc#L51-L53 in
PriorityEventQueue::check_ready(), which also writescancelled = 0. dns_result()at DNS.cc#L1365, which holds the DNSHandler's mutex, not the requester's.HostDBContinuation::remove_and_trigger_pending_dns()at HostDB.cc#L1160 (under the bucket lock) and HostDB.cc#L1169 (before it locksc->mutexat L1176).
For example, a continuation that cancels an Event scheduled on another thread of the pool writes cancelled on its own thread while the target thread's dispatcher reads it in process_queue() or check_ready(). The same goes for a HostDB or DNS requester that cancels its lookup while the DNS thread finishes it. These are data races on a non-atomic object, which is undefined behavior.
A possible fix is to make cancelled a std::atomic<bool>. The readers only need to observe a cancellation that happened before they took ownership of the Event, so acquire/release ordering is enough.
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