Skip to content

Commit 6bbd112

Browse files
committed
Handle vfkit connection in goroutine to prevent blocking
1 parent 3f50a6e commit 6bbd112

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

cmd/crc/cmd/daemon_darwin.go

+8-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,14 @@ func unixgramListener(vn *virtualnetwork.VirtualNetwork) (*net.UnixConn, error)
4444
if err != nil {
4545
return conn, errors.Wrap(err, "failed to accept vfkit connection")
4646
}
47-
err = vn.AcceptVfkit(context.Background(), vfkitConn)
48-
return conn, errors.Wrap(err, "failed to accept vfkit connection")
47+
go func() {
48+
err := vn.AcceptVfkit(context.Background(), vfkitConn)
49+
if err != nil {
50+
logging.Errorf("failed to accept vfkit connection")
51+
return
52+
}
53+
}()
54+
return conn, err
4955
}
5056

5157
func checkIfDaemonIsRunning() (bool, error) {

0 commit comments

Comments
 (0)