Skip to content

Commit

Permalink
fix Admin lostLock
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinrr888 committed Dec 10, 2024
1 parent f3fd473 commit 8cc7b39
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,11 @@ class AdminLockWatcher implements ServiceLock.AccumuloLockWatcher {
@Override
public void lostLock(ServiceLock.LockLossReason reason) {
String msg = "Admin lost lock: " + reason.toString();
log.warn(msg);
Halt.halt(msg, 1);
if (reason == ServiceLock.LockLossReason.LOCK_DELETED) {
Halt.halt(msg, 0);
} else {
Halt.halt(msg, 1);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ protected void testFateFailCommandTimeout(FateStore<LatchTestEnv> store, ServerC
// This should not work as it is already reserved and being worked on by our running FATE
// ('fate'). Admin should try to reserve it for a bit, but should fail and exit
ProcessInfo p = getCluster().exec(Admin.class, "fate", fateId1.canonical(), "--fail");
assertNotEquals(0, p.getProcess().waitFor());
assertEquals(0, p.getProcess().waitFor());
String result = p.readStdOut();

assertTrue(result.contains("Could not fail " + fateId1 + " in a reasonable time"));
Expand Down Expand Up @@ -632,7 +632,7 @@ protected void testFateDeleteCommandTimeout(FateStore<LatchTestEnv> store, Serve
// This should not work as it is already reserved and being worked on by our running FATE
// ('fate'). Admin should try to reserve it for a bit, but should fail and exit
ProcessInfo p = getCluster().exec(Admin.class, "fate", fateId1.canonical(), "--delete");
assertNotEquals(0, p.getProcess().waitFor());
assertEquals(0, p.getProcess().waitFor());
String result = p.readStdOut();

assertTrue(result.contains("Could not delete " + fateId1 + " in a reasonable time"));
Expand Down

0 comments on commit 8cc7b39

Please sign in to comment.