sadanand48 commented on code in PR #4981:
URL: https://github.com/apache/ozone/pull/4981#discussion_r1260717516


##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneFileSystem.java:
##########
@@ -766,14 +766,22 @@ private void deleteBucketFromVolume(Path f, OFSPath 
ofsPath)
       throws IOException {
     OzoneVolume volume =
         adapterImpl.getObjectStore().getVolume(ofsPath.getVolumeName());
-    try {
-      volume.deleteBucket(ofsPath.getBucketName());
-    } catch (OMException ex) {
-      // bucket is not empty
-      if (ex.getResult() == BUCKET_NOT_EMPTY) {
-        throw new PathIsNotEmptyDirectoryException(f.toString());
-      } else {
-        throw ex;
+    int retryCount = 3;
+    int count = 0;
+    while (count < retryCount) {

Review Comment:
   might be also better to add a small comment explaining why we retry here as 
a new reader can get confused about why the retry is being performed.



##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneFileSystem.java:
##########
@@ -766,14 +766,22 @@ private void deleteBucketFromVolume(Path f, OFSPath 
ofsPath)
       throws IOException {
     OzoneVolume volume =
         adapterImpl.getObjectStore().getVolume(ofsPath.getVolumeName());
-    try {
-      volume.deleteBucket(ofsPath.getBucketName());
-    } catch (OMException ex) {
-      // bucket is not empty
-      if (ex.getResult() == BUCKET_NOT_EMPTY) {
-        throw new PathIsNotEmptyDirectoryException(f.toString());
-      } else {
-        throw ex;
+    int retryCount = 3;

Review Comment:
   define this as a constant BUCKET_DELETE_RETRY_COUNT.



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