swamirishi commented on code in PR #8446:
URL: https://github.com/apache/ozone/pull/8446#discussion_r2098708802


##########
hadoop-ozone/common/src/test/java/org/apache/hadoop/ozone/om/lock/TestOzoneManagerLock.java:
##########
@@ -115,6 +118,26 @@ void testLockingOrder() {
     }
   }
 
+  @ParameterizedTest
+  @EnumSource
+  public void testFlatLockWithParallelResource(FlatResource flatResource) {
+    OzoneManagerLock lock = new OzoneManagerLock(new OzoneConfiguration());
+    List<Resource> resources = new ArrayList<>();
+    
resources.addAll(Arrays.stream(LeveledResource.values()).collect(Collectors.toList()));
+    
resources.addAll(Arrays.stream(FlatResource.values()).collect(Collectors.toList()));
+    for (Resource otherResource : resources) {
+      String[] otherResourceName = generateResourceName(otherResource);
+      String[] flatResourceName = generateResourceName(flatResource);
+      lock.acquireWriteLock(otherResource, otherResourceName);
+      try {
+        lock.acquireWriteLock(flatResource, flatResourceName);

Review Comment:
   no there would be no deadlock if threads use the bulk locks api that should 
only cause contention on resource and not deadlock.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to