You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "TeslaCN (via GitHub)" <gi...@apache.org> on 2023/04/11 04:52:43 UTC

[GitHub] [shardingsphere] TeslaCN commented on pull request #24558: Avoid ConcurrentHashMap recursive update in ShardingSphereServiceLoader.getServiceInstances

TeslaCN commented on PR #24558:
URL: https://github.com/apache/shardingsphere/pull/24558#issuecomment-1502685472

   > If users load SPI recursively when customizing SPI, I don't think it's users' fault (root cause).
   > 
   > e.g.
   > 
   > ```
   > public final class OuterSPI implements TypedSPI {
   > 
   >     // TypedSPILoader depends on ShardingSphereServiceLoader
   >     private final InnerSPI innerSPI = TypedSPILoader.getService(InnerSPI.class, "type");
   > }
   > ```
   > 
   > Users just use classes of ShardingSphere indirectly, e.g. `ShardingSphereServiceLoader`, but not use `ConcurrentHashMap` directly. And `ShardingSphereServiceLoader.getServiceInstances` javadoc doesn't declare it could not be invoked recursively.
   > 
   > Maybe we could update javadoc of `ShardingSphereServiceLoader` and also [Dev Manual](https://shardingsphere.apache.org/document/5.3.1/en/dev-manual/).
   
   Got it.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org