terrymanu commented on issue #35580:
URL: 
https://github.com/apache/shardingsphere/issues/35580#issuecomment-3643026622

   ##  Problem Understanding
     JFR shows SecureRandom causing blocking and performance regression in 
tableless unicast routing. You want to understand the reason and current 
status, with official documentation references.
   
   ##  Root Cause
     PR #35411 replaced ThreadLocalRandom with new SecureRandom() in a 
high-frequency path. SecureRandom construction and number generation depend on 
entropy sources and synchronization, which can block under load, causing slower 
performance. PR #35414 reverted this change.
   
   ##  Analysis
   
     - Current master 
(infra/route/core/.../TablelessDataSourceUnicastRouteEngine.java) has already 
restored ThreadLocalRandom:
   
   ```java
       private String getRandomDataSourceName(final Collection<String> 
dataSourceNames) {
           return new 
ArrayList<>(dataSourceNames).get(ThreadLocalRandom.current().nextInt(dataSourceNames.size()));
       }
   ```
   
     - Impact scope: only snapshots between commit 8f5b7a8d (introduced 
SecureRandom) and 07209678 (reverted) were affected; released 5.5.2 and current 
master/5.5.3-SNAPSHOT already contain the rollback.
   
   ##  Conclusion
     The performance regression has been reverted; current master no longer has 
this issue. If your runtime build comes from that brief window of commits, 
please upgrade to an official release (≥5.5.2) or current 
master/5.5.3-SNAPSHOT. If you’re already on those versions, no further action 
is needed.


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