-
Notifications
You must be signed in to change notification settings - Fork 11
ENGINE-1383: Handle Windows exit code 3010 and fix reboot after MCR install #624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
e88d4c1
65d33a4
66dd9ef
5c9d2bf
492b07d
fdea012
ccd441b
c8c44a2
08443f0
78d209d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -95,28 +95,27 @@ func (i *Image) Exist(h *mkeconfig.Host) bool { | |
| // PullImages pulls multiple images parallelly by using a worker pool. | ||
| func PullImages(h *mkeconfig.Host, images []*Image) error { | ||
| wp := workerpool.New(5) | ||
| defer wp.StopWait() | ||
|
|
||
| var mutex sync.Mutex | ||
| var lastError error | ||
|
|
||
| for _, image := range images { | ||
| i := image // So we can safely pass i forward to pool without it getting mutated | ||
| wp.Submit(func() { | ||
| mutex.Lock() | ||
| defer mutex.Unlock() | ||
| if lastError != nil { | ||
| return | ||
| } | ||
|
|
||
| err := i.Pull(h) | ||
| if err != nil { | ||
| if err := i.Pull(h); err != nil { | ||
| mutex.Lock() | ||
|
Comment on lines
102
to
106
|
||
| lastError = err | ||
| if lastError == nil { | ||
| lastError = err | ||
| } | ||
| mutex.Unlock() | ||
| } | ||
| }) | ||
| } | ||
|
|
||
| // Wait for all workers to complete before reading lastError. | ||
| // A deferred StopWait() would let the return expression evaluate | ||
| // before workers finish, potentially returning nil on a real error. | ||
| wp.StopWait() | ||
| return lastError | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isExitCode3010currently checksstrings.Contains(err.Error(), "3010"), which is overly broad and can misclassify unrelated failures whose error strings happen to include those digits. Prefer extracting the actual exit code from the underlying error type (e.g., viaerrors.Asto a command/exit error type) or at least match an exact token like"exit code 3010"/"exit status 3010"with a word-boundary regex.