Skip to content
This repository has been archived by the owner on Mar 4, 2021. It is now read-only.

java.lang.NullPointerException on BasicJanitorRuleEngine.java:76 with a leashed janitor monkey #189

Closed
lantrix opened this issue May 8, 2015 · 1 comment

Comments

@lantrix
Copy link

lantrix commented May 8, 2015

I've been running Simian Army, specifically janitor monkey, Leashed.

I get the following

java.lang.NullPointerException
    at java.util.Date.getMillisOf(Date.java:956)
    at java.util.Date.after(Date.java:929)
    at com.netflix.simianarmy.basic.janitor.BasicJanitorRuleEngine.isValid(BasicJanitorRuleEngine.java:76)
    at com.netflix.simianarmy.janitor.AbstractJanitor.markResources(AbstractJanitor.java:209)
    at com.netflix.simianarmy.basic.janitor.BasicJanitorMonkey.doMonkeyBusiness(BasicJanitorMonkey.java:95)
    at com.netflix.simianarmy.Monkey.run(Monkey.java:134)
    at com.netflix.simianarmy.Monkey$1.run(Monkey.java:155)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

From what I understand, BasicJanitorRuleEngine.java:76 ends up with the java.lang.NullPointerException due to the fact that the clone.getExpectedTerminationTime() is null because there have been no successful un-leashed runs of Janitor Monkey.

screenshot 2015-05-08 15 32 51

Will need to make this code handle null values better, as java.util.Date.after can't handle comparing to a null date.

lantrix added a commit to lantrix/SimianArmy that referenced this issue May 8, 2015
When a new leashed janitor monkey is run; there can be a situation where the expectedTerminationTime of the resource can be null (as per Issue Netflix#189). This ensures if it is null, that it won't call the java.util.Date functions which can't handle a null.
@ebukoski
Copy link
Contributor

ebukoski commented Dec 7, 2015

This was addressed with PR #191

@ebukoski ebukoski closed this as completed Dec 7, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants