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 shim std logs not close after shim exit #3311

Merged
merged 1 commit into from Jun 10, 2019

Conversation

jing-rui
Copy link
Contributor

Signed-off-by: Jing Rui jingrui@huawei.com

@theopenlab-ci
Copy link

theopenlab-ci bot commented May 29, 2019

Build succeeded.


go func() {
select {
case <-shimExit:
Copy link
Member

Choose a reason for hiding this comment

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

runtime/v1/linux/runtime.go:397:4:warning: should use a simple channel send/receive instead of select with a single case (S1000) (staticcheck)

please update it~

@fuweid
Copy link
Member

fuweid commented Jun 2, 2019

@jing-rui sorry. could you repush it? the failed case is flaky one

@theopenlab-ci
Copy link

theopenlab-ci bot commented Jun 2, 2019

Build succeeded.

@codecov-io
Copy link

Codecov Report

Merging #3311 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #3311   +/-   ##
======================================
  Coverage    44.6%   44.6%           
======================================
  Files         112     112           
  Lines       12180   12180           
======================================
  Hits         5433    5433           
  Misses       5913    5913           
  Partials      834     834
Flag Coverage Δ
#linux 48.49% <ø> (ø) ⬆️
#windows 39.87% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1c5b384...bd89073. Read the comment docs.

@codecov-io
Copy link

codecov-io commented Jun 2, 2019

Codecov Report

Merging #3311 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3311   +/-   ##
=======================================
  Coverage   44.86%   44.86%           
=======================================
  Files         113      113           
  Lines       12338    12338           
=======================================
  Hits         5535     5535           
  Misses       5953     5953           
  Partials      850      850
Flag Coverage Δ
#linux 48.79% <ø> (ø) ⬆️
#windows 40.25% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 02ed02e...d069449. Read the comment docs.

@@ -392,6 +394,16 @@ func (r *Runtime) loadTasks(ctx context.Context, ns string) ([]*Task, error) {
go io.Copy(ioutil.Discard, shimStderrLog)
}

go func() {
Copy link
Member

Choose a reason for hiding this comment

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

Would it be better to close these after the io.Copy operations unblock?

Copy link
Member

Choose a reason for hiding this comment

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

+1

Copy link
Member

Choose a reason for hiding this comment

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

or put the go goroutine at the beginning to make sure that the log can be closed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@crosbymichael the io.Copy still block after shim exit, so close it directly after shim exit. or wait it with timeout?

Copy link
Member

Choose a reason for hiding this comment

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

it should unblock

Copy link
Member

Choose a reason for hiding this comment

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

hi @crosbymichael , the fifo is opened with write and read so that the copy still is blocked after shim exits. So I think we should close the fifo after NewShimClient call.

@fuweid
Copy link
Member

fuweid commented Jun 7, 2019

@jing-rui ping ^^

@theopenlab-ci
Copy link

theopenlab-ci bot commented Jun 9, 2019

Build succeeded.

case <-copyDone:
break
}
if src != nil {
Copy link
Member

Choose a reason for hiding this comment

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

I think we can remove the nil check here, because the scope is clear here. And the if src is nil, the inner goroutine will panic.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Jun 10, 2019

Build succeeded.

Signed-off-by: Jing Rui <jingrui@huawei.com>
Copy link
Member

@fuweid fuweid left a comment

Choose a reason for hiding this comment

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

LGTM

@crosbymichael
Copy link
Member

LGTM

@crosbymichael crosbymichael merged commit 42f4bb9 into containerd:master Jun 10, 2019
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.

None yet

4 participants