rangareddy commented on code in PR #19486:
URL: https://github.com/apache/hudi/pull/19486#discussion_r3709859335


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/transaction/lock/FileSystemBasedLockProvider.java:
##########
@@ -63,14 +63,30 @@
 @Slf4j
 public class FileSystemBasedLockProvider implements LockProvider<String>, 
Serializable {
   private static final String LOCK_FILE_NAME = "lock";
+  /**
+   * Guards this provider's lock-file operations.
+   *
+   * <p>These blocks used to synchronize on {@link #LOCK_FILE_NAME}. That is a 
compile-time String
+   * constant, so it is interned and shared JVM-wide with every other {@code 
"lock"} literal - including
+   * {@code FileSystemBasedLockProviderTestClass}, which declares its own 
{@code static final String LOCK =

Review Comment:
   Applied. The javadoc now states the mechanism without naming anything that 
can be renamed:
   
   ```java
   * <p>These blocks used to synchronize on {@link #LOCK_FILE_NAME}. That is a 
compile-time String constant,
   * so it is interned: any class anywhere in the JVM that synchronizes on the 
same {@code "lock"} literal
   * contends on the very same monitor and silently couples itself to Hudi's 
lock acquisition. A private
   * object cannot be aliased that way.
   ```
   
   The concrete instance stays in the commit message and the PR description, 
where it is evidence that the hazard is real rather than theoretical, and where 
going stale costs nothing. Agreed that a production comment which silently rots 
on a test rename is the wrong place for 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to