kevinrr888 commented on code in PR #5670:
URL: https://github.com/apache/accumulo/pull/5670#discussion_r2164837216


##########
server/base/src/main/java/org/apache/accumulo/server/util/Admin.java:
##########
@@ -968,19 +968,27 @@ private void executeFateOpsCommand(ServerContext context, 
FateOpsCommand fateOps
       } else if (fateOpsCommand.fail) {
         adminLock = createAdminLock(context);
         fateStores = createFateStores(context, zk, adminLock);
-        for (String fateIdStr : fateOpsCommand.fateIdList) {
-          if (!admin.prepFail(fateStores, fateIdStr)) {
-            throw new AccumuloException("Could not fail transaction: " + 
fateIdStr);
+        try {
+          for (String fateIdStr : fateOpsCommand.fateIdList) {
+            if (!admin.prepFail(fateStores, fateIdStr)) {
+              throw new AccumuloException("Could not fail transaction: " + 
fateIdStr);
+            }
           }
+        } finally {
+          closeFateStores(fateStores.values());
         }
       } else if (fateOpsCommand.delete) {
         adminLock = createAdminLock(context);
         fateStores = createFateStores(context, zk, adminLock);
-        for (String fateIdStr : fateOpsCommand.fateIdList) {
-          if (!admin.prepDelete(fateStores, fateIdStr)) {
-            throw new AccumuloException("Could not delete transaction: " + 
fateIdStr);
+        try {
+          for (String fateIdStr : fateOpsCommand.fateIdList) {
+            if (!admin.prepDelete(fateStores, fateIdStr)) {
+              throw new AccumuloException("Could not delete transaction: " + 
fateIdStr);
+            }
+            admin.deleteLocks(zk, zTableLocksPath, fateIdStr);
           }
-          admin.deleteLocks(zk, zTableLocksPath, fateIdStr);
+        } finally {
+          closeFateStores(fateStores.values());

Review Comment:
   Yeah, that's a good point. I added a new inner class `FateStores` to 
accomplish this 795c88b529e92d9fb9195248b33ba48351b87997



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