Skip to content
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
5 changes: 4 additions & 1 deletion internal/uvm/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ func (uvm *UtilityVM) Start(ctx context.Context) (err error) {
}()
defer cancel()

// create exitCh ahead of time to prevent race conditions between writing
// initalizing the channel and waiting on it during acceptAndClose
uvm.exitCh = make(chan struct{})

// Prepare to provide entropy to the init process in the background. This
// must be done in a goroutine since, when using the internal bridge, the
// call to Start() will block until the GCS launches, and this cannot occur
Expand Down Expand Up @@ -208,7 +212,6 @@ func (uvm *UtilityVM) Start(ctx context.Context) (err error) {
}()

// Start waiting on the utility VM.
uvm.exitCh = make(chan struct{})
go func() {
err := uvm.hcsSystem.Wait()
if err == nil {
Expand Down