Add a fault-injection test for the signal transport drain
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
- 48/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- c, macos
- Lĩnh vực
- operating-systems, testing
Hướng nghiên cứu
Start with drain_signal_transport and transport_read_chunk in src/syscall/proc.c, then trace preempt_thread_main and drain_after_wait to understand retries and warning behavior. Add a host unit test using a scratch transport file and fault hooks for the listed host calls. Verify retry state, record handling, warning frequency, failed truncation, and the first-flock size bound under concurrent appends.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
drain_signal_transport in src/syscall/proc.c has failure paths that no test reaches: open failing with an error other than ENOENT, the flock, fstat or pread in transport_read_chunk failing, and a failed ftruncate. On a failure the drain keeps the records, sets transport_retry, and the SIGALRM tick in preempt_thread_main retries it. Since #505, sys_wait4 and sys_waitid also retry a failed drain once inline (drain_after_wait) before they return, and the warning is logged once per run of failures (transport_read_failing). The size bound added in #505 (a drain stops at the file size it saw under its first flock) is also only checked by reading: no test keeps a sender appending while a drain runs.
A guest test cannot make these host calls fail, so a regression on any of these paths would pass make check and make test-matrix.
Proposal
Add a host unit test that drives the drain against a scratch transport file with the host calls it makes wrapped behind a small fault hook (fail the next N calls of open, flock, fstat, pread or ftruncate with a chosen errno). It would check that:
- no record is lost or handled twice across a failed and a retried drain;
transport_retryis set after each kind of failure and cleared by a drain that succeeds;- the warning is logged once per run of failures;
- a failed truncate leaves the offset at the end, so the next drain does not handle the same records again;
- a drain ends at the size it saw under its first flock while another thread keeps appending, and the next drain picks up the rest.
Alternatives
A guest test under a second elfuse build that injects the failures. That build would not run in CI.
Origin
Follow-up from #505 (https://github.com/sysprog21/elfuse/pull/505#discussion_r4542048059). Related: #507.
- Ngôn ngữ chính
- C
- Star
- 287
- Fork
- 33
- Merge trung bình
- 2 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 18
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 sysprog21/elfuse
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của sysprog21/elfuse
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
libreswan/libreswan#3185 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
[SDL3pp] update to 0.12.0Đang mởcategory:port-update
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 2 ngày
-
[InstCombine] 23.x folds 0.0 * (0.0 / x) to 0.0 when x may be zero (fixed on main by #202482)Đang mởllvm:instcombine
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
llvm/llvm-project#246503 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày