Avoid repeated reachability walks while Moose modules initialize
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
Hướng nghiên cứu
Start in WeakRefRegistry.weaken(), at the weakenedLiveBlessedRef condition, where reachableOwnerCount() is evaluated before ModuleInitGuard.inModuleInit(). Follow reachableOwnerCount() into ReachabilityWalker.isScalarReachable() to see the root walk. Reorder the check, add a deterministic regression test for module initialization, and confirm weak-reference behaviour outside module init. Done when t/05_round.t finishes on both the JVM and interpreter backends.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Loading StorageDisplay 1.0.11 through Moose triggers a large number of Scalar::Util::weaken calls. For live blessed references, WeakRefRegistry.weaken() calls reachableOwnerCount(), which repeatedly walks the Perl object graph. The module-initialization guard is checked only after this expensive query, so it does not suppress the work during module loading. The repeated walks make t/05_round.t exceed the CPAN tester timeout on both PerlOnJava backends.
Evidence
- CPAN random tester run:
20261102-094403-98885 - Distribution:
StorageDisplay-1.0.11; failing test:t/05_round.t - System Perl 5.42.2: full suite passed, 7 files / 85 tests, in about 6 seconds.
- PerlOnJava 5.44.1 / Java 24.0.2: CPAN run timed out after 120 seconds with no output for 60 seconds. Focused runs of
t/05_round.twith the archived dependency overlay exceeded a 40-second hard timeout on both JVM and interpreter backends. - An 8-second JVM Flight Recorder profile of
use StorageDisplayshowed repeated stacks throughScalarUtil.weaken,RuntimeBase.reachableOwnerCount, andReachabilityWalkerroot traversal. This is repeated work, not evidence of an infinite loop.
StorageDisplay is pure Perl and uses Moose 2.4000 and namespace::sweep 0.006. The PerlOnJava report showed t/000-report-versions.t passing before the harness stopped producing output.
Suspected cause
In WeakRefRegistry.weaken(), the condition at the weakenedLiveBlessedRef check evaluates base.reachableOwnerCount() == 0 before !ModuleInitGuard.inModuleInit(). reachableOwnerCount() checks each active owner using ReachabilityWalker.isScalarReachable(), which traverses the global root graph. Moose performs many such weaken operations while required modules execute under ModuleInitGuard, multiplying full root walks during initialization.
Move the module-init check ahead of the reachability query, then confirm the same behavior is preserved outside module initialization.
Acceptance criteria
- Add deterministic regression coverage proving module initialization does not perform the expensive reachable-owner walk for this path.
- Run new/changed Perl-level coverage with system Perl first.
t/05_round.tcompletes under PerlOnJava's JVM and interpreter backends with the archived dependency load order.- Run the required build and lifecycle tests; retain bounded output and verify weak-reference semantics outside module initialization.
Related: #1642 and merged PR #1746 addressed other repeated reachability paths during cleanup. This CPAN case reproduces through WeakRefRegistry.weaken() during module initialization.
- Ngôn ngữ chính
- Perl
- Star
- 65
- Fork
- 8
- Merge trung bình
- 5 giờ 52 phút
- Pull request đã merge (30 ngày)
- 175
Chuẩn bị môi trường
- Có Dockerfile hoặc 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 fglock/PerlOnJava
-
area:runtime documentation enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
fglock/PerlOnJava#1579 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:runtime bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 22/100
fglock/PerlOnJava#1951 ·
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 35/100
fglock/PerlOnJava#1885 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:performance enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
fglock/PerlOnJava#1863 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:memory area:performance area:runtime bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
fglock/PerlOnJava#1860 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của fglock/PerlOnJava
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
virtualmin/virtualmin-gpl#1322 ·
-
`singletitle`/`uniquetitle`/`uniquework` only ignore entries whose `options` field contains the literal token `skipbib`; `skipbib=true` and `dataonly` still countCó thể đã có người làm @plk đã nhận 1 ngày trước. Đang mởBug fixedindev
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
easy first-contributor first-contributors good first issue help wanted perl shell up-for-grabs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
fork-commit-merge/fork-commit-merge#8461 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
PostgreSQL::Version rejects documented full psql version outputCó thể đã có người làm @feitiansiyan đã nhận 1 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
IvorySQL/IvorySQL#2999 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
1.severity: security
Độ 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 1 ngày