runtime: NumGoroutine counts exiting goroutines, iter.TestPull flakes
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
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- operating-systems, testing-qa
Hướng nghiên cứu
Start with tinygo_task_exited in src/internal/task/task_threads.c (around line 98), where the threads scheduler stops counting an exiting goroutine, and with the GOMAXPROCS stub in src/runtime/runtime.go (around line 30). Reproduce by running the upstream iter TestPull repeatedly on the threads scheduler and watch the goroutine counts. Done means TestPull passes reliably, for example by making NumGoroutine exclude goroutines that have finished, or by making the baseline wait for them to exit.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
iter's TestPull is upstream Go's test, run unchanged from GOROOT. It failed once in CI on an unrelated PR (#6229), in the assert-stdlib-test-linux job:
https://github.com/tinygo-org/tinygo/actions/runs/42597317396/job/129094472336
--- FAIL: TestPull (0.01s)
--- FAIL: TestPull/1 (0.00s)
have 0 extra goroutines, want 1
have 0 extra goroutines, want 1
have 0 extra goroutines, want 1
have -1 extra goroutines, want 0
have -1 extra goroutines, want 0
have -1 extra goroutines, want 0
have -1 extra goroutines, want 0
have -1 extra goroutines, want 0
FAIL iter 0.030s
The first wantNG(0) passed, and every check after Pull was one low. So a goroutine that was counted in the baseline exited during the subtest.
On Linux the threads scheduler stops counting a goroutine in tinygo_task_exited. That runs after the goroutine function returns (src/internal/task/task_threads.c:98). t.Run returns as soon as the subtest goroutine signals it is done, so TestPull/0's thread can still be counted when TestPull/1 takes its baseline. Upstream stableNumGoroutine uses GOMAXPROCS(1) and Gosched to let other goroutines finish first. TinyGo ignores GOMAXPROCS (src/runtime/runtime.go:30), so on the threads scheduler the baseline can include a goroutine that is about to exit.
- Ngôn ngữ chính
- Go
- Star
- 17.8k
- Fork
- 1.1k
- Merge trung bình
- 1 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 380
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 tinygo-org/tinygo
-
avr: SPI Mode2 runs as mode 1Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
tinygo-org/tinygo#6727 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
tinygo-org/tinygo#6711 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Builds are not reproducible: cgo snippet paths in debug infoCó thể đã có người làm @tridev-tej đã nhận 1 ngày trước. Đang mởenhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
tinygo-org/tinygo#6619 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Fix the targets that tinygo build -target rejectsCó thể đã có người làm @narguis đã nhận 2 ngày trước. Đang mởbug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
tinygo-org/tinygo#6617 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
tinygo-org/tinygo#6312 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của tinygo-org/tinygo
Issue tương tự
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
sresarehumantoo/cc-artex#456 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ollama/ollama#20021 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
factory:subtask
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
release
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
github/gh-aw-mcpg#17603 ·
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
bboerst/stratum-work#351 ·
Maintainer thường phản hồi trong vòng 1 ngày