exec::start_now: request_stop() on the storage does not reach the senders
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Read include/exec/async_scope.hpp around __nest_receiver::get_env and include/exec/start_now.hpp around __storage and __receiver to trace which stop token reaches the sender. Then inspect test/exec/async_scope/test_start_now.cpp and add coverage for calling storage.request_stop(); done means the test observes the sender stop instead of run. Pull request #2417 is already open for this issue.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
exec::start_now returns a storage object with request_stop() and get_token(), but a stop request on that object never reaches the started senders. request_stop() returns true and the senders keep running.
Reproducer
#include <stdexec/execution.hpp>
#include <exec/async_scope.hpp>
#include <exec/start_now.hpp>
#include <cstdio>
namespace ex = stdexec;
int main() {
ex::run_loop loop;
exec::async_scope scope;
bool ran = false;
bool stopped = false;
auto storage = exec::start_now(
scope,
ex::schedule(loop.get_scheduler())
| ex::then([&]() noexcept { ran = true; })
| ex::upon_stopped([&]() noexcept { stopped = true; }));
bool accepted = storage.request_stop();
loop.finish();
loop.run();
ex::sync_wait(scope.on_empty());
std::printf("request_stop=%d ran=%d stopped=%d\n", accepted, ran, stopped);
}
Expected: request_stop=1 ran=0 stopped=1
Actual: request_stop=1 ran=1 stopped=0
Tested on main at 081ab7fc with clang 21.1.8 and g++ 14. Calling scope.request_stop() instead of storage.request_stop() does stop the sender, so the run loop's scheduler honors stop requests in this program.
Cause
__storage puts its own token in the environment of __receiver, and then wraps each sender with __scope.nest(...). __nest_receiver::get_env in include/exec/async_scope.hpp overrides get_stop_token with the scope's token, so the sender only ever sees the scope's token. The token from __storage::get_token() compares unequal to the one the sender reads.
test/exec/async_scope/test_start_now.cpp has no test that calls request_stop().
- Ngôn ngữ chính
- C++
- Star
- 2.5k
- Fork
- 284
- Merge trung bình
- 2 ngày 32 phút
- Pull request đã merge (30 ngày)
- 88
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 NVIDIA/stdexec
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
NVIDIA/stdexec#1751 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 45/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 Hơn một tuần Mức phù hợp với người mới 18/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 18/100
NVIDIA/stdexec#2402 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của NVIDIA/stdexec
Issue tương tự
-
documentation enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
QuantStack/git2cpp#203 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
BaptisteHudyma/Lamp-Da#588 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug macOS networking
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
docling-project/docling-parse#448 ·
Maintainer thường phản hồi trong vòng 5 ngày