v2: Open log fifo with RDWR instead of WRONLY#2591
Conversation
|
Nice catch @darfux! |
|
/test |
Codecov Report
@@ Coverage Diff @@
## master #2591 +/- ##
==========================================
+ Coverage 50.47% 50.55% +0.08%
==========================================
Files 118 118
Lines 17016 17030 +14
==========================================
+ Hits 8588 8610 +22
+ Misses 7387 7372 -15
- Partials 1041 1048 +7 |
5db9db5 to
5d3029e
Compare
|
Hi @grahamwhaley . I've added a test for |
|
/test |
1 similar comment
|
/test |
|
I wonder why the travis-ci is always in pending state. Is there something wrong with it...? |
5d3029e to
039c46a
Compare
|
It looks like Travis passed, but must have failed to send that result back to GitHub. I've restarted the Travis job so hopefully it will work this time... |
|
repushed to see whether the travis-ci can be triggered 👀 |
|
s/Jenkins/Travis/. @darfux - ah thanks ;) |
|
@jodh-intel Thanks for explain XD |
The container log fifo is opened as `O_WRONLY` now. When the read side of fifo is closed temporarily such as restarting contaienrd, write to `tty.Stdout` will get an EPIPE error and finally cause `io.CopyBuffer` return. Then `ioCopy` closes the tty io and exits. Thus after containerd restarted, the log fifo can't be reopened. The container will be blocked forever after stdout/stderr buffer is full. Opening the log fifo with `RDWR` instead of `WRONLY` avoids the fifo returning EPIPE when the read side is closed, and keeps the fifo open until the reader reopening it. Fixes: kata-containers#2590 Signed-off-by: Li Yuxuan <liyuxuan04@baidu.com>
039c46a to
8e0f891
Compare
|
Hi @jodh-intel . I've repushed twice but it seems that Travis still failed to send the result back😂 Is there any way else to fix it? |
|
@darfux please try closing and reopening this PR |
|
thanks @devimc |
|
ouch! travis still stuck 😒 |
|
Travis looks to have ack'd now - there are 2 other CI fails - expected?? |
|
@grahamwhaley both CI have passed the related case before: http://jenkins.katacontainers.io/job/kata-containers-runtime-ubuntu-18-04-PR-initrd/2987/ (failed due to env but So I think it was flaky? Could you please restart the two CI 😃 |
|
sure, two CIs restarted... |
|
Thanks @grahamwhaley . All CIs are happy now 🎊 |
The container log fifo is opened as
O_WRONLYnow. When the read side of fifo is closed temporarily such as restarting contaienrd, write totty.Stdoutwill get an EPIPE error and finally causeio.CopyBufferreturn. ThenioCopycloses the tty io and exits. Thus after containerd restarted, the log fifo can't be reopened. The container will be blocked forever after stdout/stderr buffer is full.Opening the log fifo with
RDWRinstead ofWRONLYavoids the fifo returning EPIPE when the read side is closed, and keeps the fifo open until the reader reopening it.Fixes: #2590
Signed-off-by: Li Yuxuan liyuxuan04@baidu.com