[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-9796?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15876514#comment-15876514
 ] 

ASF GitHub Bot commented on CLOUDSTACK-9796:
--------------------------------------------

Github user rafaelweingartner commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1956#discussion_r102292787
  
    --- Diff: 
engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java ---
    @@ -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 --
    
    Ok, now I think I am starting to get it.
    But I am still not sure about some things here, would you mind continue 
discussing?
    
    If the work is not null, you get the previous step (let’s assume it is not 
null) and call the method ` _workDao.updateStep(work, step)`. After this, you 
call ` stateTransitTo(vm, event, hostId)`. Why do we need to call ` 
_workDao.updateStep(work, previousStep)` again? The ` previousStep ` continues 
to be the same.


> Null Pointer Exception in VirtualMachineManagerImpl.java
> --------------------------------------------------------
>
>                 Key: CLOUDSTACK-9796
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9796
>             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 VirtualMachineManagerImpl.java .  I have attached a snippet of 
> a log file of this NPE occurring in the wild.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to