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.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to