[moby backport] Remove ERROR_PROC_NOT_FOUND from error checks #1066
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Same as #1065; backport of #1064 for the "moby" branch, which is currently used for the Docker 20.10 releases.
Relates to moby/moby#42611
Previously, certain error check functions like IsAlreadyStopped returned
true if the error was ERROR_PROC_NOT_FOUND. Based on the comment in the
file, this was intended to be used to indicate a case where the process
could not be found. However, it seems this may have been added
erroneously. ERROR_PROC_NOT_FOUND is actually typically used to mean
that a procedure lookup failed, and has nothing to do with processes.
The original change[1] to check against ERROR_PROC_NOT_FOUND was made
five years ago, and did not contain much information on why this error
would be returned. We are removing this now based on several factors:
ERROR_PROC_NOT_FOUND to indicate a condition "process does not exist".
ERROR_PROC_NOT_FOUND due to something failing internally. The current
error checks are causing this to be treated as "the container has
already exited", causing moby to not properly stop the container via
HcsTerminateComputeSystem.
This change leaves the definition for ErrProcNotFound in the code, as it
may be used by external callers, but fixes its comment.
[1]: See commit 0ae7e7e
Signed-off-by: Kevin Parsons kevpar@microsoft.com
(cherry picked from commit d78544d)
Signed-off-by: Sebastiaan van Stijn github@gone.nl