Skip to content

Commit 863c519

Browse files
committed
Properly close exitCh under certain conditions
Signed-off-by: Maksym Pavlenko <[email protected]>
1 parent b6b0a11 commit 863c519

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

machine.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,11 @@ func (m *Machine) startVMM(ctx context.Context) error {
336336
os.Remove(m.cfg.LogFifo)
337337
os.Remove(m.cfg.MetricsFifo)
338338
errCh <- err
339+
340+
// Notify subscribers that there will be no more values.
341+
// When err is nil, two reads are performed (waitForSocket and close exitCh goroutine),
342+
// second one never ends as it tries to read from empty channel.
343+
close(errCh)
339344
}()
340345

341346
// Set up a signal handler and pass INT, QUIT, and TERM through to firecracker

0 commit comments

Comments
 (0)