Avoid repeated reachability walks while Moose modules initialize
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Perl
- スター
- 65
- フォーク
- 8
- 平均マージ
- 5時間 49分
- マージ済み PR(30日)
- 177
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
fglock/PerlOnJava のほかの issue
-
area:runtime documentation enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
fglock/PerlOnJava#1579 ·
メンテナーはふだん 1 日以内に返信
-
Autovivify undefined hash reference in list assignment対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンarea:runtime bug
難易度 4/5 1〜2日 初心者へのやさしさ 55/100
fglock/PerlOnJava#1958 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area:io bug
難易度 4/5 3〜5日 初心者へのやさしさ 56/100
fglock/PerlOnJava#1957 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
area:cpan-port enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
fglock/PerlOnJava#1955 ·
メンテナーはふだん 1 日以内に返信
-
area:runtime bug
難易度 4/5 3〜5日 初心者へのやさしさ 22/100
fglock/PerlOnJava#1951 ·
メンテナーはふだん 1 日以内に返信
fglock/PerlOnJava の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 2 日以内に返信
-
wave-followup
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
-
benchmarks/README: 'perl BNG2.pl model.bngl' runs the whole protocol, not just generate_networkオープンdocumentation
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 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 count対応中かも @plk が 2 日前に担当しました。 オープンBug fixedindev
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100