You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/06/27 16:52:33 UTC

[GitHub] [pinot] jackjlli commented on a diff in pull request #8971: Fix thread safety issue with java client

jackjlli commented on code in PR #8971:
URL: https://github.com/apache/pinot/pull/8971#discussion_r907595459


##########
pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/ConnectionFactory.java:
##########
@@ -173,7 +174,11 @@ public static Connection fromHostList(Properties properties, List<String> broker
 
   private static PinotClientTransport getDefault() {
     if (_defaultTransport == null) {
-      _defaultTransport = new JsonAsyncHttpPinotClientTransportFactory().buildTransport();
+      synchronized (TRANSPORT_LOCK) {

Review Comment:
   You can replace this `TRANSPORT_LOCK` object with `ConnectionFactory.class`, so that you don't need an extra object in the class.



-- 
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: commits-unsubscribe@pinot.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org