diff --git a/indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskLockbox.java b/indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskLockbox.java index ca4d4526557..9a2f7854221 100644 --- a/indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskLockbox.java +++ b/indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskLockbox.java @@ -201,7 +201,6 @@ public class TaskLockbox task.getId(), task.getGroupId() ); - continue; } } @@ -237,6 +236,7 @@ public class TaskLockbox * groupId, dataSource, and priority. */ @VisibleForTesting + @Nullable protected TaskLockPosse verifyAndCreateOrFindLockPosse(Task task, TaskLock taskLock) { giant.lock(); @@ -297,6 +297,12 @@ public class TaskLockbox return createOrFindLockPosse(request); } + catch (Exception e) { + log.error(e, + "Could not reacquire lock for task: %s from metadata store", task.getId() + ); + return null; + } finally { giant.unlock(); } diff --git a/indexing-service/src/test/java/org/apache/druid/indexing/overlord/TaskLockboxTest.java b/indexing-service/src/test/java/org/apache/druid/indexing/overlord/TaskLockboxTest.java index 908e554a465..fd93aff2ba7 100644 --- a/indexing-service/src/test/java/org/apache/druid/indexing/overlord/TaskLockboxTest.java +++ b/indexing-service/src/test/java/org/apache/druid/indexing/overlord/TaskLockboxTest.java @@ -449,9 +449,9 @@ public class TaskLockboxTest ); final TaskLockbox lockbox = new TaskLockbox(taskStorage, metadataStorageCoordinator); - expectedException.expect(IllegalArgumentException.class); - expectedException.expectMessage("lock priority[10] is different from task priority[50]"); - lockbox.syncFromStorage(); + TaskLockboxSyncResult result = lockbox.syncFromStorage(); + Assert.assertEquals(1, result.getTasksToFail().size()); + Assert.assertTrue(result.getTasksToFail().contains(task)); } @Test