gnodet opened a new pull request, #12325: URL: https://github.com/apache/maven/pull/12325
## Summary Replace the shared `ConcurrentHashMap.newKeySet()` used for `activeModelReads` cycle detection with a `Set<Path>` passed through the call stack. The original fix (PR #12314) used a shared concurrent set across all derived sessions to prevent the StackOverflowError from GH-12301. While this works correctly on `maven-4.0.x` today, it has a latent race condition: parallel threads in `PhasingExecutor` (`loadFilePom`) that read the same model simultaneously can falsely block each other's `getEnhancedProperties()` from reading that model. This race manifests on `master` (broke `ConsumerPomBuilderTest.testSimpleConsumer` when forward-ported as #12317). The fix passes the `Set<Path>` as a method parameter through the call chain: - `doReadFileModel(activeModelReads)` → adds current path, passes to both parent resolution and `getEnhancedProperties()` - `getEnhancedProperties(model, rootDir, activeModelReads)` → checks set before reading root model - `readFileModel(activeModelReads)` → threads the set through the cache call Each call chain (from `readFileModel()` entry point) carries its own set, so parallel threads never interfere. ## Test plan - [x] `DefaultModelBuilderTest` — 12/12 pass - [x] `ConsumerPomBuilderTest` — 7/7 pass - [x] Full IT suite — 1029 pass, 0 failures, 51 skipped _Fully automatic review from Claude Code_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
