Skip to content

fix shim std logs not close after shim exit#3311

Merged
crosbymichael merged 1 commit intocontainerd:masterfrom
jing-rui:shimlog
Jun 10, 2019
Merged

fix shim std logs not close after shim exit#3311
crosbymichael merged 1 commit intocontainerd:masterfrom
jing-rui:shimlog

Conversation

@jing-rui
Copy link
Copy Markdown
Contributor

Signed-off-by: Jing Rui [email protected]

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented May 29, 2019

Build succeeded.

Comment thread runtime/v1/linux/runtime.go Outdated
Copy link
Copy Markdown
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
Copy Markdown
Member

fuweid commented Jun 2, 2019

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

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Jun 2, 2019

Build succeeded.

@codecov-io
Copy link
Copy Markdown

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
Copy Markdown

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.

Comment thread runtime/v1/linux/runtime.go Outdated
Copy link
Copy Markdown
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
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

fuweid commented Jun 7, 2019

@jing-rui ping ^^

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Jun 9, 2019

Build succeeded.

Comment thread runtime/v1/linux/runtime.go Outdated
Copy link
Copy Markdown
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
Copy Markdown

theopenlab-ci Bot commented Jun 10, 2019

Build succeeded.

Copy link
Copy Markdown
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
Copy Markdown
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.

4 participants