cloudstack-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (CLOUDSTACK-9796) Null Pointer Exception in
Date Tue, 21 Feb 2017 20:12:51 GMT


ASF GitHub Bot commented on CLOUDSTACK-9796:

Github user nathanejohnson commented on a diff in the pull request:
    --- Diff: engine/orchestration/src/com/cloud/vm/ ---
    @@ -744,14 +744,17 @@ protected boolean checkWorkItems(final VMInstanceVO vm, final State
state) throw
         protected <T extends VMInstanceVO> boolean changeState(final T vm, final Event
event, final Long hostId, final ItWorkVO work, final Step step) throws NoTransitionException
             // FIXME: We should do this better.
    -        final Step previousStep = work.getStep();
    -        _workDao.updateStep(work, step);
    +        Step previousStep = null;
    +        if (work != null) {
    +            previousStep = work.getStep();
    --- End diff --
    I'm not sure I'm following.  From reading the code a bit, it looks like the only scenario
where a false would be returned from stateTransitTo would be where the state was not properly
persisted to the db.  No exception is thrown in that case.  In the current code, false *or*
exception will try to revert.  Also, currently previousStep would *probably* never be null
- though if work is null this will cause another NPE on line 747 of current code.  In the
PR, previousStep will *probably* only be null in the case where work is null.
    What is the value of making a distinction from a false versus an exception in this case?
 Me adding a check for previousStep != null is simply to make sure that work is not null above.
 I could also check work for null here too, but I don't think that's what you're getting at.

> Null Pointer Exception in
> --------------------------------------------------------
>                 Key: CLOUDSTACK-9796
>                 URL:
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the default.) 
>    Affects Versions: 4.8.0, 4.9.0
>         Environment: Cloudstack 4.8
>            Reporter: Nathan Johnson
>            Assignee: Nathan Johnson
>            Priority: Minor
>         Attachments: npelog.txt
> When a situation occurs where a VM hangs in the "Starting" state for longer than the
job.expire.minutes, and the job is deleted from the system, a null pointer exception will
occur because the work VO will be null inside of advanceStop in
.  I have attached a snippet of a log file of this NPE occurring in the wild.

This message was sent by Atlassian JIRA

View raw message