Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit ffa17e8

Browse files
authored
Merge pull request #488 from bergwolf/startpod
Startpod failure
2 parents 652ea59 + a1b36c2 commit ffa17e8

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

hypervisor/hypervisor.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func (ctx *VmContext) handlePAEs() {
4444
}
4545

4646
func (ctx *VmContext) watchHyperstart(sendReadyEvent bool) {
47-
timeout := time.AfterFunc(30*time.Second, func() {
47+
timeout := time.AfterFunc(60*time.Second, func() {
4848
if ctx.PauseState == PauseStateUnpaused {
4949
ctx.Log(ERROR, "watch hyperstart timeout")
5050
ctx.Hub <- &InitFailedEvent{Reason: "watch hyperstart timeout"}
@@ -69,7 +69,7 @@ func (ctx *VmContext) watchHyperstart(sendReadyEvent bool) {
6969
sendReadyEvent = false
7070
}
7171
time.Sleep(10 * time.Second)
72-
timeout.Reset(30 * time.Second)
72+
timeout.Reset(60 * time.Second)
7373
}
7474
timeout.Stop()
7575
}

hypervisor/vm.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,9 @@ func (vm *Vm) WaitProcess(isContainer bool, ids []string, timeout int) <-chan *a
226226
return result
227227
}
228228

229-
func (vm *Vm) InitSandbox(config *api.SandboxConfig) {
229+
func (vm *Vm) InitSandbox(config *api.SandboxConfig) error {
230230
vm.ctx.SetNetworkEnvironment(config)
231-
vm.ctx.startPod()
231+
return vm.ctx.startPod()
232232
}
233233

234234
func (vm *Vm) WaitInit() api.Result {

hypervisor/vm_states.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,16 +181,17 @@ func streamCopy(tty *TtyIO, stdinPipe io.WriteCloser, stdoutPipe, stderrPipe io.
181181
once.Do(cleanup)
182182
}
183183

184-
func (ctx *VmContext) startPod() {
184+
func (ctx *VmContext) startPod() error {
185185
err := ctx.hyperstart.StartSandbox(ctx.networks.sandboxInfo())
186186
if err == nil {
187187
ctx.Log(INFO, "pod start successfully")
188188
ctx.reportSuccess("Start POD success", []byte{})
189189
} else {
190-
reason := "Start POD failed"
190+
reason := fmt.Sprintf("Start POD failed: %s", err.Error())
191191
ctx.reportVmFault(reason)
192192
ctx.Log(ERROR, reason)
193193
}
194+
return err
194195
}
195196

196197
func (ctx *VmContext) shutdownVM() {

0 commit comments

Comments
 (0)