mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-21 06:09:39 +08:00
Merge pull request #846 from wanyaoqi/bugfix/wyq/fix-host-on-start-failed
bugfix : fix guest on start failed no call task failed
This commit is contained in:
@@ -364,9 +364,10 @@ func (s *SGuestLiveMigrateTask) startMigrate(string) {
|
||||
|
||||
func (s *SGuestLiveMigrateTask) startMigrateStatusCheck(string) {
|
||||
s.c = make(chan struct{})
|
||||
for {
|
||||
for s.c != nil {
|
||||
select {
|
||||
case <-s.c: // on c close
|
||||
s.c = nil
|
||||
break
|
||||
case <-time.After(time.Second * 1):
|
||||
s.Monitor.GetMigrateStatus(s.onGetMigrateStatus)
|
||||
|
||||
@@ -273,7 +273,10 @@ func (s *SKVMGuestInstance) asyncScriptStart(ctx context.Context, params interfa
|
||||
return nil, nil
|
||||
} else {
|
||||
log.Infof("Async start server %s failed: %s!!!", s.GetName(), err)
|
||||
timeutils2.AddTimeout(100*time.Millisecond, s.SyncStatus)
|
||||
if ctx != nil && len(appctx.AppContextTaskId(ctx)) >= 0 {
|
||||
hostutils.TaskFailed(ctx, fmt.Sprintf("Async start server failed: %s", err))
|
||||
}
|
||||
s.SyncStatus()
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
@@ -750,10 +753,10 @@ func (s *SKVMGuestInstance) Stop() bool {
|
||||
}
|
||||
|
||||
func (s *SKVMGuestInstance) scriptStart() error {
|
||||
_, err := procutils.NewCommand("sh", s.GetStartScriptPath()).Run()
|
||||
output, err := procutils.NewCommand("sh", s.GetStartScriptPath()).Run()
|
||||
if err != nil {
|
||||
s.scriptStop()
|
||||
return err
|
||||
return fmt.Errorf("Start VM Failed %s %s", output, err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user