lokeshj1703 commented on code in PR #13077:
URL: https://github.com/apache/hudi/pull/13077#discussion_r2026539783


##########
hudi-common/src/main/java/org/apache/hudi/common/table/timeline/TimeGeneratorBase.java:
##########
@@ -85,20 +85,26 @@ public TimeGeneratorBase(HoodieTimeGeneratorConfig config, 
StorageConfiguration<
 
   protected LockProvider<?> getLockProvider() {
     // Perform lazy initialization of lock provider only if needed
-    if (lockProvider == null) {
+    String lockProviderClass = 
lockConfiguration.getConfig().getString("hoodie.write.lock.provider");
+    LOG.info("LockProvider for TimeGenerator: {}", lockProviderClass);
+    if (!LockProvider.isThreadSafe(lockProviderClass)) {
+      return createLockProvider(lockProviderClass);

Review Comment:
   Yes, it can cause issues with performance and heap usage. I think a better 
fix would be make it thread safe instead. We will not be able to make 
HiveMetastoreBasedLockProvider as thread safe though. So we would need a fix 
for HiveMetastoreBasedLockProvider atleast.



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