Skip to content
This repository has been archived by the owner on Jul 16, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1020 from rbradford/fix-1009
Browse files Browse the repository at this point in the history
ciao-launcher: Wait for virtualizer to terminate
  • Loading branch information
rbradford authored Jan 17, 2017
2 parents db44985 + 79e0571 commit fe47dd3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ciao-launcher/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,11 @@ func (id *instanceData) deleteCommand(cmd *insDeleteCmd) bool {
if id.monitorCh != nil {
glog.Infof("Powerdown %s before deleting", id.instance)
id.monitorCh <- virtualizerStopCmd{}
select {
case <-id.monitorCloseCh:
case <-time.After(time.Second * 10):
glog.Warningf("Timeout (10s) waiting for virtualizer to terminate")
}
id.vm.lostVM()
}

Expand Down
1 change: 1 addition & 0 deletions ciao-launcher/instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ func (v *instanceTestState) deleteInstance(t *testing.T, ovsCh chan interface{},
t.Errorf("Invalid monitor command found %t, expected virtualizerStopCmd", monCmd)
return false
}
close(v.monitorClosedCh)
case <-time.After(time.Second):
t.Error("Timed out waiting for ovsStatsUpdateCmd")
return false
Expand Down

0 comments on commit fe47dd3

Please sign in to comment.