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
sys/mount_linux: use pipe for communicating mount result #4160
sys/mount_linux: use pipe for communicating mount result #4160
Conversation
Build succeeded.
|
7bbfb87
to
290b2f7
Compare
Build succeeded.
|
Do you have tests? |
Codecov Report
@@ Coverage Diff @@
## master #4160 +/- ##
==========================================
+ Coverage 42.44% 45.70% +3.26%
==========================================
Files 133 119 -14
Lines 15210 12212 -2998
==========================================
- Hits 6456 5582 -874
+ Misses 7821 5698 -2123
+ Partials 933 932 -1
Continue to review full report at Codecov.
|
@AkihiroSuda Since the race condition related issue is only reproduced by introducing some delay within the FMountat function, I'm not sure how this particular scenario can be easily tested. Suggestions are welcome. |
forkAndMountat forks a process to chdir then mount layers. Signals are blocked (using runtime_beforeFork) during fork. There is a race condition that the child process finishes before the parent process is scheduled and can unblock signal handling. The SIGCHLD signal sent from the finished process may have been delivered to the shim process's reaper thread and caused the parent process fail with ECHLD error. This patch sets up a pipe for communication between child and parent instead of waiting for child exit status. Fixes containerd#4009. Signed-off-by: Haitao Li <hli@atlassian.com>
290b2f7
to
35c14c6
Compare
Build succeeded.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
forkAndMountat forks a process to chdir then mount layers. Signals are
blocked (using runtime_beforeFork) during fork.
There is a race condition that the child process finishes before the
parent process is scheduled and can unblock signal handling. The SIGCHLD
signal sent from the finished process may have been delivered to the
shim process's reaper thread and caused the parent process fail with
ECHLD error.
This patch sets up a pipe for communication between child and parent
instead of waiting for child exit status.
Fixes #4009.