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 shouldn't cause any contention. -- 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: issues-unsubscr...@ozone.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org For additional commands, e-mail: issues-h...@ozone.apache.org