-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue 85: turbineSensor throws occasional NPE #111
Issue 85: turbineSensor throws occasional NPE #111
Conversation
…ts instead of consumeStats in reader and lack of null check parsing read events). Signed-off-by: Raúl Gracia <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this.
return CompletableFuture.completedFuture(null); | ||
}, Long.parseLong(result.getEvent().split(",")[0]), 100); | ||
totalEvents--; | ||
} | ||
} catch (ReinitializationRequiredException e) { | ||
e.printStackTrace(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's create an issue to remove this print stack trace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I will create it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Fix in TurbineHeatSensor.java to avoid the application to throw NullPointerException. Note that this PR only targets this specific problem (i.e., other exceptions or problems will be treated separately). Signed-off-by: Raúl Gracia <[email protected]>
Change log description
Fix in
TrubineHeatSensor.java
for avoiding the application to throwNullPointerException
. Note that this PR only targets this specific problem (i.e., other exceptions or problems will be treated separately).Purpose of the change
Fixes #85.
What the code does
The reader (
SensorReader
) is incorrectly interacting withproduceStats
instead of withconsumeStats
. Moreover, the read loop of this class parses read events without checking for null events (e.g., after timeout). The fix consists of replacing reader interactions fromproduceStats
toconsumeStats
as well as to check for a null read event before executing the parse logic.How to verify it
Execute the application and verify that it does not throws NPE.