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

fix: fix cri exec hang #2224

Merged
merged 1 commit into from
Sep 12, 2018
Merged

fix: fix cri exec hang #2224

merged 1 commit into from
Sep 12, 2018

Conversation

Ace-Tang
Copy link
Contributor

@Ace-Tang Ace-Tang commented Sep 10, 2018

do not return error when execProcess.Start() fail, if exec process
started, let execExitedAndRelease do the exit hook.

Signed-off-by: Ace-Tang [email protected]

Ⅰ. Describe what this PR did

Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)

will add in cri by @starnop .

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@pouchrobot pouchrobot added kind/bug This is bug report for project size/XS size/S and removed size/XS labels Sep 10, 2018
@Ace-Tang
Copy link
Contributor Author

If exec process get run, io should be closed in the function , still have no iead why it can't close backend after function. If io closed after the function, log followed will miss.

close containerio backend: hijack, id: c7b8106b3420b1b27e3dc3996a151ce0e4db2bec1d2e60730bb479650ce31cae

do not return error when execProcess.Start() fail, if exec process
started, let execExitedAndRelease do the exit hook.

Signed-off-by: Ace-Tang <[email protected]>
if err := <-fail; err != nil {
msg.err = err
// exit code should not be zero when exec get failed.
if msg.exitCode == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whether it is possible exitCode is not zero when exec got error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It possible, like exec $id aaaaa .

}
}
// XXX: if exec process get run, io should be closed in this function,
for _, hook := range c.hooks {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now, no matter run exec got an error or not, we always call the exit hook.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, when exec start , no matter what result, let hook do the clean. Before exec start, if got error, let pouch daemon level do the clean.

@HusterWan
Copy link
Contributor

lgtm

@pouchrobot pouchrobot added the LGTM one maintainer or community participant agrees to merge the pull reuqest. label Sep 12, 2018
@Ace-Tang
Copy link
Contributor Author

Ace-Tang commented Sep 12, 2018

@allencloud , merge this after #2226 pass ci.

@allencloud
Copy link
Collaborator

LGTM

@allencloud allencloud merged commit 270093c into AliyunContainerService:master Sep 12, 2018
@starnop
Copy link
Contributor

starnop commented Sep 12, 2018

@Ace-Tang All tests has been passed. ^_^

@Ace-Tang
Copy link
Contributor Author

@starnop , thanks for test ! I think we can merge #2226 now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug This is bug report for project LGTM one maintainer or community participant agrees to merge the pull reuqest. size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants