-
Notifications
You must be signed in to change notification settings - Fork 950
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
bugfix: attach hanging of cri container #2130
Conversation
Signed-off-by: YaoZengzeng <yaozengzeng@zju.edu.cn>
f5d89f5
to
c0a3ae2
Compare
Codecov Report
@@ Coverage Diff @@
## master #2130 +/- ##
==========================================
- Coverage 64.88% 64.84% -0.05%
==========================================
Files 208 208
Lines 16458 16465 +7
==========================================
- Hits 10679 10676 -3
- Misses 4451 4459 +8
- Partials 1328 1330 +2
|
Stdin: openStdin, | ||
Stdout: true, | ||
Stderr: true, | ||
CriLogFile: f, |
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.
Just double check this fd will be closed when finished, right? @YaoZengzeng
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.
It will be closed when IO is finished.
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.
could we disable json-file here? I mean that we can disable json-file in other PR.
Stdin: openStdin, | ||
Stdout: true, | ||
Stderr: true, | ||
CriLogFile: f, |
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.
could we disable json-file here? I mean that we can disable json-file in other PR.
} | ||
err = c.ContainerMgr.Attach(context.Background(), containerID, attachConfig) | ||
if err != nil { | ||
return fmt.Errorf("failed to attach to container %q to get its log: %v", containerID, err) |
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.
how about pkgerrors.Wrapf
?
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.
Yes, we could change all this stuff of CRI in another PR.
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.
cool
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.
LGTM
Signed-off-by: YaoZengzeng yaozengzeng@zju.edu.cn
Ⅰ. Describe what this PR did
If we want to get the log of cri container, the step as follows:
create container
attach to the io of the container
start the container
Then the IO of the container will be created in step 2
So we should decide whether open the Stdin of Container IO, otherwise it will never be opened
which will result the hanging of attach
Ⅱ. Does this pull request fix one issue?
Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews