sys/mount_linux: use pipe for communicating mount result#4160
Merged
estesp merged 1 commit intocontainerd:masterfrom Apr 9, 2020
Merged
Conversation
|
Build succeeded.
|
7bbfb87 to
290b2f7
Compare
|
Build succeeded.
|
Member
|
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.
|
Contributor
Author
|
@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. |
fuweid
reviewed
Apr 8, 2020
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 <[email protected]>
290b2f7 to
35c14c6
Compare
|
Build succeeded.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.