Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Abandoned
-
2.0.0, 1.x
-
None
-
None
Description
In HDFSSpout a NPE can occur if a stale lock file is empty.
LogEntry.deserialize tries to split the line by colons.
If the line is null, the split will cause a NPE:
https://github.com/apache/storm/blob/master/external/storm-hdfs/src/main/java/org/apache/storm/hdfs/spout/FileLock.java#L179
Moreover the callee of getLastEntry is also mishandling empty log files.
The lastEntry.eventTime could also cause a NPE if the above scenario is passed and the log file is empty:
https://github.com/apache/storm/blob/master/external/storm-hdfs/src/main/java/org/apache/storm/hdfs/spout/FileLock.java#L149-L160