From f86342f7dc9cefdc74936707af9258e5e33342a5 Mon Sep 17 00:00:00 2001 From: Gian Merlino Date: Thu, 19 Dec 2013 16:16:20 -0800 Subject: [PATCH] DbTaskStorage: Protect against invalid lock_payload --- .../io/druid/indexing/overlord/DbTaskStorage.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/indexing-service/src/main/java/io/druid/indexing/overlord/DbTaskStorage.java b/indexing-service/src/main/java/io/druid/indexing/overlord/DbTaskStorage.java index 5dc6e1c6fff..cf0fb4f3e24 100644 --- a/indexing-service/src/main/java/io/druid/indexing/overlord/DbTaskStorage.java +++ b/indexing-service/src/main/java/io/druid/indexing/overlord/DbTaskStorage.java @@ -489,7 +489,18 @@ public class DbTaskStorage implements TaskStorage final Map retMap = Maps.newHashMap(); for (final Map row : dbTaskLocks) { - retMap.put((Long) row.get("id"), jsonMapper.readValue((byte[]) row.get("lock_payload"), TaskLock.class)); + try { + retMap.put( + (Long) row.get("id"), + jsonMapper.readValue((byte[]) row.get("lock_payload"), TaskLock.class) + ); + } + catch (Exception e) { + log.makeAlert(e, "Failed to deserialize TaskLock") + .addData("task", taskid) + .addData("lockPayload", row) + .emit(); + } } return retMap; }