Skip to content
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

[release/0.8] Remove ERROR_PROC_NOT_FOUND from error checks #1065

Merged
merged 1 commit into from
Jul 8, 2021

Conversation

kevpar
Copy link
Member

@kevpar kevpar commented Jul 8, 2021

Backport to release/0.8 of #1064.

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:

  • We are not aware of any condition where HCS would intentionally return
    ERROR_PROC_NOT_FOUND to indicate a condition "process does not exist".
  • There is an issue where HcsShutdownComputeSystem sometimes returns
    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: Kevin Parsons kevpar@microsoft.com

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:

- We are not aware of any condition where HCS would intentionally return
  ERROR_PROC_NOT_FOUND to indicate a condition "process does not exist".
- There is an issue where HcsShutdownComputeSystem sometimes returns
  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: Kevin Parsons <kevpar@microsoft.com>
@kevpar kevpar requested a review from a team as a code owner July 8, 2021 18:58
@kevpar kevpar merged commit 3ad51c7 into microsoft:release/0.8 Jul 8, 2021
thaJeztah added a commit to thaJeztah/docker that referenced this pull request Jul 9, 2021
…756a991ad09cf7c (moby branch)

Brings in microsoft/hcsshim#1065, which fixes moby#42610.

full diff: microsoft/hcsshim@89a9a3b...64a2b71

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
kevpar added a commit to kevpar/moby that referenced this pull request Jul 13, 2021
Full set of changes: microsoft/hcsshim@v0.8.16...v0.8.20

Importantly brings in microsoft/hcsshim#1065,
which fixes moby#42610.

Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
docker-jenkins pushed a commit to docker-archive/docker-ce that referenced this pull request Jul 14, 2021
Full set of changes: microsoft/hcsshim@v0.8.16...v0.8.20

Importantly brings in microsoft/hcsshim#1065,
which fixes #42610.

Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
Upstream-commit: f7eaf2bf78e031c2f28259359cf4efb6655bcf5a
Component: engine
nosamad pushed a commit to WAGO/docker-engine that referenced this pull request Sep 13, 2021
…756a991ad09cf7c (moby branch)

Brings in microsoft/hcsshim#1065, which fixes moby#42610.

full diff: microsoft/hcsshim@89a9a3b...64a2b71

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
nosamad pushed a commit to WAGO/docker-engine that referenced this pull request Sep 15, 2021
…756a991ad09cf7c (moby branch)

Brings in microsoft/hcsshim#1065, which fixes moby#42610.

full diff: microsoft/hcsshim@89a9a3b...64a2b71

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
nosamad pushed a commit to WAGO/docker-engine that referenced this pull request Sep 28, 2021
…756a991ad09cf7c (moby branch)

Brings in microsoft/hcsshim#1065, which fixes moby#42610.

full diff: microsoft/hcsshim@89a9a3b...64a2b71

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants