apex-malhar icon indicating copy to clipboard operation
apex-malhar copied to clipboard

APEXMALHAR-2566 Fixed NPE in FSWindowDataManager

Open patilvikram opened this issue 5 years ago • 4 comments

patilvikram avatar Apr 10 '19 12:04 patilvikram

Is it possible to come up with a unit test for this. Looks like the NPE happens only in some cases.

pramodin avatar Apr 25 '19 23:04 pramodin

There are checkstyle errors, please see

[ERROR] src/main/java/org/apache/apex/malhar/lib/wal/FSWindowDataManager.java:[487,11] (whitespace) WhitespaceAround: WhitespaceAround: 'if' is not followed by whitespace. [ERROR] src/main/java/org/apache/apex/malhar/lib/wal/FSWindowDataManager.java:[488] (indentation) Indentation: 'reader' have incorrect indentation level 11, expected level should be 12.

This looks like an edge case as this code generally works and doesn't error always. If it is an edge case and you are unable to come up with a unit test due to that reason, if there is no objection from others, I am ok to merge it without a unit test in this case.

pramodin avatar May 28 '19 23:05 pramodin

I am not fully convinced that this is the right fix without a unit test. Looking at readNext() implementation, I would suspect that null is returned when the next record was not fully written or there is actually I/O problem. It is not clear, why is it OK to suppress I/O exception in readNext() instead of propagating it as retrieve() signature suggests. For the incomplete written record, it should be possible to create a unit test and see what should be the correct behavior.

vrozov avatar May 29 '19 06:05 vrozov

@patilvikram can you respond to @vrozov comments

pramodin avatar Jun 03 '19 15:06 pramodin