net: a replaced copy let go with its track open loses a group it gave up under the resume point
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 45/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ệ
- rust
- Lĩnh vực
- distributed-systems
Hướng nghiên cứu
Start with rs/moq-net/src/model/resume.rs and reproduce the failure using the supplied test in mod test, checking why asked_for(&b, 2) is false. Then read Reader::owed and how it handles replaced copies and runs they can still deliver. Done means the fill for group 2 is retained and the supplied scenario passes without breaking the three named regression tests.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
A logical reader can lose a group under the serving copy's resume point after a route switch, when a replaced copy gives that group up and is then let go while its track stays open.
Scenario
- Route A's copy holds groups 0, 1 and 4. The reader reads them, then the front switches to route B, whose live feed starts at 4 (so 2 and 3 can come from B only as fills).
- A drops group 2, while group 3 may still land on it.
Reader::owedsubtracts A's whole fed span (copy.replaced && !copy.fills && copy.feeds), so no fill is kept for 2 either. - A then skips group 3 while its track stays open. Nothing is left to land on A, so
Copy::retainsreturnsNoandlet_godrops it. ran_shortre-arms the serving route's walk only whenpoll_firstsees the copy end cleanly (done = Some(Ok)), which never happens here.gave_upcovers onlydrains. Nothing asks B for group 2, and an ordered read waits at it.
This affects bounded and unbounded reads alike. On main it predates moq-dev/moq#10176, which only widened owed and ran_short to unbounded reads.
Reproduction
Add this to rs/moq-net/src/model/resume.rs's mod test. It fails at asked_for(&b, 2):
/// A replaced copy let go while its track stays open, after giving up one group the reader
/// lacks and having the rest it still fed skipped, leaves that group to the serving route:
/// no fill was kept for what it still fed.
#[test]
fn a_replaced_copy_let_go_open_has_a_group_it_gave_up_asked_again() {
let routes = Producer::new();
let logical = logical(&routes);
let a = received_copy();
routes.serve(a.consume());
let mut sub = subscribe_until(&logical, 6);
for key in [0, 1, 4] {
write(&a, key);
}
let mut got = drain(&mut sub, false);
got.sort_unstable();
assert_eq!(got, [0, 1, 4]);
let mut b = received_copy();
routes.serve(b.consume());
// Its live feed starts at the resume point, so 2 comes only as a fill.
b.start_at(4).unwrap();
write(&b, 5);
assert_eq!(drain(&mut sub, false), [5]);
// The old route gives 2 up while 3 may still land on it.
a.drop_groups(2..3);
assert!(sub.poll_recv_group(&fresh()).is_pending());
// Then it skips 3, its track still open, so nothing is left to land on it.
a.skip_groups(3..4);
assert!(sub.poll_recv_group(&fresh()).is_pending());
assert!(sub.poll_recv_group(&fresh()).is_pending());
assert!(asked_for(&b, 2), "{:?}", b.subscription());
write(&b, 2);
assert_eq!(drain(&mut sub, false), [2]);
}
What a fix has to keep
The obvious fix re-arms Resumed::Route whenever let_go drops a copy that still fed a group the reader lacks under the resume point. That over-asks: it breaks a_kept_out_key_above_a_finished_backfill_is_asked_from_itself (a copy let go past the budget gets asked again), and even limited to copies within their budget it breaks an_unplaced_time_start_waits_on_a_replaced_copy and ..._only_to_its_end (the serving route gets asked for history those tests leave unasked). The reviewer's suggestion is narrower: in Reader::owed, subtract only the runs the replaced copy can still deliver (not its drops), so the fill for group 2 is kept.
Found by Codex review on moq-dev/moq#10176.
(Written by Claude Opus 5.5)
- Ngôn ngữ chính
- Rust
- Star
- 1.6k
- Fork
- 251
- Merge trung bình
- 10 giờ 10 phút
- Pull request đã merge (30 ngày)
- 822
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 moq-dev/moq
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
moq-dev/moq#10463 · 1 bình luận · 1 reaction ·
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
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 82/100
moq-dev/moq#10460 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
quest
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
moq-dev/moq#10373 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
quest
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
moq-dev/moq#10336 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
Test connection's password prompt says the password is never saved, also for a keychain profileĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area: settings bug Haiku review: no-score ui
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
MMFoundation/WallpaperMachine#346 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Make the HTTP server's keep-alive and headers timeouts configurableCó thể đã có người làm @mattgodbolt đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
compiler-explorer/compiler-explorer#9902 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
jonathanong/no-mistakes#5490 ·
-
follow-up
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày