Copilot commented on code in PR #18497:
URL: https://github.com/apache/iotdb/pull/18497#discussion_r3858911810
##########
iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/DeepCopyRpcTransportFactory.java:
##########
@@ -21,8 +21,14 @@
import org.apache.thrift.transport.TTransportFactory;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
public class DeepCopyRpcTransportFactory extends BaseRpcTransportFactory {
+ private static final Map<FactoryConfig, DeepCopyRpcTransportFactory>
INSTANCES =
+ new ConcurrentHashMap<>();
Review Comment:
This process-wide cache retains every distinct pair of client-supplied
buffer/frame sizes forever. Applications that create and close sessions or JDBC
connections with varying configurations will therefore accumulate
`FactoryConfig`, factory, and inner-factory objects with no eviction path.
Please bound/expire the cache or create these lightweight immutable factories
per connection so closed client configurations can be reclaimed.
--
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]