-
Notifications
You must be signed in to change notification settings - Fork 259
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
Fix race condition in legacy process stdio code #737
Conversation
cd42497
to
b432e59
Compare
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.
Looks good with some suggestions.
b432e59
to
2371af8
Compare
HcsCreateProcess returns a set of stdio handles for the newly created process. A while ago, we used to cache these handles and return them the first time stdio handles were requested for the process, and then get new handles via HcsGetProcessInfo for each subsequent request. At some point, this code was cleaned up to instead always return the original set of handles as non-closable (for new callers) and always get new handles via HcsGetProcessInfo (for legacy callers, who required closable handles). However, this change introduced a race condition for legacy callers, where in the case of a short lived container process, the container could have terminated between when it was started and when the orchestrator requested stdio handles. This led to ERROR_NOT_FOUND being returned from HcsGetProcessInfo. This change addresses this by returning the original handles the first time stdio handles are requested, and then calling HcsGetProcessInfo for every subsequent request (just as it used to work a while ago). Signed-off-by: Kevin Parsons <[email protected]>
2371af8
to
b3f49c0
Compare
Among other things, this is required to pull in microsoft/hcsshim#718 which should take care of multiple issues reported to us. Also fixes microsoft/hcsshim#737 which was caught by checks while attempting to bump up hcsshim version. Modifies TestRunAttachFailedNoLeak to do case-insensitive comparison to fix a failure on RS1. Signed-off-by: Vikram bir Singh <[email protected]>
Among other things, this is required to pull in microsoft/hcsshim#718 Also fixes microsoft/hcsshim#737 which was caught by checks while attempting to bump up hcsshim version. Signed-off-by: Vikram bir Singh <[email protected]>
Among other things, this is required to pull in microsoft/hcsshim#718 Also fixes microsoft/hcsshim#737 which was caught by checks while attempting to bump up hcsshim version. Signed-off-by: Vikram bir Singh <[email protected]> Upstream-commit: a7b6c3f0bf5d10c6227a29bac7dd46b9a7a779bc Component: engine
Among other things, this is required to pull in microsoft/hcsshim#718 Also fixes microsoft/hcsshim#737 which was caught by checks while attempting to bump up hcsshim version. Signed-off-by: Vikram bir Singh <[email protected]> (cherry picked from commit a7b6c3f) Signed-off-by: Sebastiaan van Stijn <[email protected]>
I'm not sure if this PR is responsible for a new error I'm seeing or not -- but something in between nightly docker 2019-09-25 and nightly docker 2019-12-04 is causing errors on container exit under LCOW with a
This is the last change to roll in that modified |
Among other things, this is required to pull in microsoft/hcsshim#718 Also fixes microsoft/hcsshim#737 which was caught by checks while attempting to bump up hcsshim version. Signed-off-by: Vikram bir Singh <[email protected]> (cherry picked from commit a7b6c3f0bf5d10c6227a29bac7dd46b9a7a779bc) Signed-off-by: Sebastiaan van Stijn <[email protected]> Upstream-commit: e2f226b5b41c958fa518f677eb213eb1462f90a8 Component: engine
HcsCreateProcess returns a set of stdio handles for the newly created
process. A while ago, we used to cache these handles and return them
the first time stdio handles were requested for the process, and then
get new handles via HcsGetProcessInfo for each subsequent request. At
some point, this code was cleaned up to instead always return the
original set of handles as non-closable (for new callers) and always get
new handles via HcsGetProcessInfo (for legacy callers, who required
closable handles).
However, this change introduced a race condition for legacy callers,
where in the case of a short lived container process, the container
could have terminated between when it was started and when the
orchestrator requested stdio handles. This led to ERROR_NOT_FOUND
being returned from HcsGetProcessInfo.
This change addresses this by returning the original handles the first
time stdio handles are requested, and then calling HcsGetProcessInfo for
every subsequent request (just as it used to work a while ago).
Signed-off-by: Kevin Parsons [email protected]