Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions hyperstart/libhyperstart/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,11 @@ func handleMsgToHyperstart(h *jsonBasedHyperstart, conn io.WriteCloser) {
// delay version-awared command
h.Log(TRACE, "delay version-awared command :%d", cmd.Code)
time.AfterFunc(2*time.Millisecond, func() {
defer func() {
if err := recover(); err != nil && h.closed {
cmd.result <- fmt.Errorf("hyperstart closed")
}
}()
h.ctlChan <- cmd
})
continue
Expand Down Expand Up @@ -324,6 +329,11 @@ func handleMsgToHyperstart(h *jsonBasedHyperstart, conn io.WriteCloser) {
}

func handleMsgFromHyperstart(h *jsonBasedHyperstart, conn io.Reader) {
defer func() {
if err := recover(); err != nil {
h.Log(WARNING, "panic during handleMsgFromHyperstart (closed: %v): %v", h.closed, err)
}
}()
for {
res, err := readVmMessage(conn)
if err == nil {
Expand Down