efegokdemir opened a new pull request, #204: URL: https://github.com/apache/maven-toolchains-plugin/pull/204
Closes #173. Concurrent JDK discovery can add a cache entry while another call is writing the cache. The write then clears the modified flag, so that entry is not persisted. Cache updates now coordinate with the snapshot used for persistence. A failed write leaves the cache marked dirty, and concurrent discoveries of the same JDK reuse the first cached model. A latch-controlled regression test reproduces the lost update and verifies that the next write persists it. Validation: - `JAVA_HOME=/opt/homebrew/opt/openjdk@21 mvn clean -Dspotless.skip=true -Dtest=ToolchainDiscovererTest test` — passed (2 tests). - `JAVA_HOME=/opt/homebrew/opt/openjdk@21 mvn spotless:check` — passed. - `JAVA_HOME=/opt/homebrew/opt/openjdk@21 mvn -Prun-its verify` — passed (8 integration tests). - Regression test failed on the unmodified implementation because the concurrent JDK entry was absent from the cache file. - `git diff --check` — passed. --- To make clear that you license your contribution under the [Apache License Version 2.0, January 2004](https://www.apache.org/licenses/LICENSE-2.0), check one of the following: - [x] I hereby declare this contribution to be licensed under the [Apache License Version 2.0, January 2004](https://www.apache.org/licenses/LICENSE-2.0) - [ ] I hereby declare that I have filed an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). -- 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]
