fix pipe in broken may cause shim lock forever#2807
fix pipe in broken may cause shim lock forever#2807estesp merged 2 commits intocontainerd:masterfrom
Conversation
|
Looks like there's a possible flaky test (https://ci.appveyor.com/project/mlaventure/containerd-3g73f/builds/20380056); |
f3329f8 to
4b00f07
Compare
Codecov Report
@@ Coverage Diff @@
## master #2807 +/- ##
==========================================
- Coverage 47.41% 43.73% -3.68%
==========================================
Files 91 100 +9
Lines 8411 10730 +2319
==========================================
+ Hits 3988 4693 +705
- Misses 3700 5307 +1607
- Partials 723 730 +7
Continue to review full report at Codecov.
|
|
@thaJeztah It looks like a random error. Squash all commits make it success. |
|
Yes, it looked like a flaky test, so your new push triggered CI again, and now it passes. I'm not a maintainer of this repository, but it may be cleaner to keep the V1 and V2 changes as separate commits though, so that (if needed) the V1 change can be backported separately to older release branches 😅 |
4b00f07 to
b3438f7
Compare
Signed-off-by: Lifubang <lifubang@acmcoder.com>
9851472 to
e76a887
Compare
Signed-off-by: Lifubang <lifubang@acmcoder.com>
|
LGTM |
| @@ -49,9 +49,11 @@ func (p *linuxPlatform) CopyConsole(ctx context.Context, console console.Console | |||
| cwg.Add(1) | |||
There was a problem hiding this comment.
The stdin fifo will be open twice in shim. stdin copy goroutine exit, when fifo is broken or closed by manual.
So, I prefer to remove the cwg.Done() and cwg.Add(1) from here.
There was a problem hiding this comment.
However, I can't reproduce it in my local 😂
|
The exit event handler will shutdown the console socket. But if the It doesn't like non-termnial that stdout pipe will be closed after process exits. It seem that there is no side effect to close console in stdin pipe side. So LGTM. |
|
I think I meet this problem, container can not be delete, and it wait in |
Signed-off-by: Lifubang lifubang@acmcoder.com
There is an issue in moby: moby/moby#38064
It's hard to reproduce, but if you are lucky, you'll reproduce it successfully with probability about 0.1. Wish you success. If someone can write a go program with libcontainerd to reproduce it, it will help for us to debug it.
For container in created state, if pipe in broken, moby will call DeleteTask, and it will cause a wait in:
containerd/runtime/v1/linux/proc/init.go
Line 252 in e76a887
Because in
containerd/runtime/v1/shim/service_linux.go
Line 78 in e76a887
But in
containerd/runtime/v1/shim/service_linux.go
Line 54 in e76a887
@fuweid I know your team are working on shim lock improvement, PTAL.