mirror of https://github.com/apache/druid.git
DbTaskStorage: Protect against invalid lock_payload
This commit is contained in:
parent
846c3da4ab
commit
f86342f7dc
|
@ -489,7 +489,18 @@ public class DbTaskStorage implements TaskStorage
|
||||||
|
|
||||||
final Map<Long, TaskLock> retMap = Maps.newHashMap();
|
final Map<Long, TaskLock> retMap = Maps.newHashMap();
|
||||||
for (final Map<String, Object> row : dbTaskLocks) {
|
for (final Map<String, Object> 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;
|
return retMap;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue