Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ public int compare(Pair<Task, TaskLock> left, Pair<Task, TaskLock> right)
task.getId(),
task.getGroupId()
);
continue;
}
}

Expand Down Expand Up @@ -237,6 +236,7 @@ public int compare(Pair<Task, TaskLock> left, Pair<Task, TaskLock> right)
* groupId, dataSource, and priority.
*/
@VisibleForTesting
@Nullable
protected TaskLockPosse verifyAndCreateOrFindLockPosse(Task task, TaskLock taskLock)
{
giant.lock();
Expand Down Expand Up @@ -297,6 +297,12 @@ protected TaskLockPosse verifyAndCreateOrFindLockPosse(Task task, TaskLock taskL

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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,9 @@ public void testSyncFromStorageWithInvalidPriority() throws EntryExistsException
);

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