mridulm commented on code in PR #2555:
URL: https://github.com/apache/celeborn/pull/2555#discussion_r1680344215


##########
client/src/main/java/org/apache/celeborn/client/read/LocalPartitionReader.java:
##########
@@ -51,7 +51,7 @@
 public class LocalPartitionReader implements PartitionReader {
 
   private static final Logger logger = 
LoggerFactory.getLogger(LocalPartitionReader.class);
-  private static volatile ThreadPoolExecutor readLocalShufflePool;
+  private volatile ThreadPoolExecutor readLocalShufflePool;

Review Comment:
   That is a reasonable recommandation when sufficient care is not taken to 
address the issues.
   Here, we are doing the right thing by making sure it is initialized in a 
safe manner the first time the intiial instance of the class is created
   
   Also note that the current change is a regression - for each instance of 
`LocalPartitionReader` we will create a new thread pool.



##########
client/src/main/java/org/apache/celeborn/client/ShuffleClientImpl.java:
##########
@@ -126,13 +125,7 @@ public class ShuffleClientImpl extends ShuffleClient {
   private final boolean authEnabled;
   private final TransportConf dataTransportConf;
 
-  private final ThreadLocal<Compressor> compressorThreadLocal =
-      new ThreadLocal<Compressor>() {
-        @Override
-        protected Compressor initialValue() {
-          return Compressor.getCompressor(conf);
-        }
-      };
+  private ThreadLocal<Compressor> compressorThreadLocal;
 

Review Comment:
   Yes, but that error prone recommandation is asking us to use a `static` 
variable - here it is not `static`: and additionally is no longer final ?



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