-
Notifications
You must be signed in to change notification settings - Fork 256
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
Remove ERROR_PROC_NOT_FOUND from error checks #1064
Conversation
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>
@kevpar Is this where the moby culprit is I gather? https://github.com/moby/moby/blob/b57e71941eaedcd163fd0f73bfad5dc2f8cf4986/libcontainerd/local/local_windows.go#L1072 |
That's correct. If |
Awesome find (might have already said this) 😄 |
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.
fun stuff, lgtm
@AbelHu fyi |
Related work items: microsoft#930, microsoft#962, microsoft#1004, microsoft#1008, microsoft#1039, microsoft#1045, microsoft#1046, microsoft#1047, microsoft#1052, microsoft#1053, microsoft#1054, microsoft#1057, microsoft#1058, microsoft#1060, microsoft#1061, microsoft#1063, microsoft#1064, microsoft#1068, microsoft#1069, microsoft#1070, microsoft#1071, microsoft#1074, microsoft#1078, microsoft#1079, microsoft#1081, microsoft#1082, microsoft#1083, microsoft#1084, microsoft#1088, microsoft#1090, microsoft#1091, microsoft#1093, microsoft#1094, microsoft#1096, microsoft#1098, microsoft#1099, microsoft#1102, microsoft#1103, microsoft#1105, microsoft#1106, microsoft#1108, microsoft#1109, microsoft#1115, microsoft#1116, microsoft#1122, microsoft#1123, microsoft#1126
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