BobSong-dev opened a new pull request, #7140:
URL: https://github.com/apache/shenyu/pull/7140

   Fixes #6775
   
   ## Background
   
   ExtensionLoader#getJoins() treated cachedInstances.size() matching the 
number of extension classes as proof that every cached Holder was ready. 
However, getJoin() publishes a new Holder before populating its order and 
value. A concurrent getJoins() call could therefore sort or return an 
incompletely initialized holder, causing an NPE or a null element.
   
   ## Changes
   
   - Track Holder initialization with a volatile flag published after order and 
value are set;
   - Use the cached fast path only when every cached Holder is fully 
initialized;
   - Add a concurrent regression test for getJoins() observing an incomplete 
Holder.
   
   ## Verification
   
   - .\mvnw.cmd -pl shenyu-spi test -DskipITs: 20 tests passed, 0 failures, 0 
errors, 0 skipped;
   - Checkstyle: 0 violations;
   - git diff --check: passed;
   - Not run: full-project integration tests and e2e tests.


-- 
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]

Reply via email to