-
Notifications
You must be signed in to change notification settings - Fork 207
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
Fix: async (background) mount may cause problems #1088
Merged
Merged
Conversation
This file contains 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
vibhansa-msft
requested review from
souravgupta-msft,
andyzhangx and
gapra-msft
March 21, 2023 06:51
cvvz
commented
Mar 21, 2023
cvvz
commented
Mar 21, 2023
cvvz
commented
Mar 21, 2023
Since this PR has been merged by the maintainer of go-daemon, I think we can use PIPE now. @vibhansa-msft |
vibhansa-msft
approved these changes
Mar 21, 2023
LGTM |
souravgupta-msft
approved these changes
Mar 21, 2023
These changes are impacting the UT and code-coverage a lot :( |
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.
Fix
#1079
Pod deletion will cause global mount point to disappear. The root cause is csi driver will bind mount the global mount point into Pod volume immediately after
blobfuse2 mount
return successfully. However, fuse is still mounting at background, so actually bind mount and fuse mount happened at the same time, this will lead to a problem that unmount the bind mount (when deleting a Pod) will cause the original mount point unmounted as well.#1081
Mount is actually failed, but the errno returned by blobfuse2 is 0 and no error log (both terminal and log file).
Why
-f
option to decide whether running the process in foreground or as a daemon process. Daemonizaion is based onfork
.-f
option to avoid damonizing in libfuse.How
libfuse_init
callback can be an indicator that the mount operation has been successfully completed. At this point child process can send a signal to parent process to notify it that mount has been completed successfully and it can exit normally.sigchild
signal, it means the child process exited unexpectedly, and the parent process will exit with error code and error message sent by child.so I redirect the child process stderr to a temp file. By reading this file before exiting, parent process can print error message in terminal. BTW,go-daemon
usesforkExec
to fork and exec a new child process, so it's impossible to use PIPE for communicating since after exec, they won't share any opened file descriptor.Test
I've done test manually and it can solve the problem in both #1079 and #1081.
csi driver
To be safe, blob csi driver has to use
IsLikelyNotMountPoint
orMountedFast
after executingblobfuse2 mount
to make sure the mount point is really mounted successfully. Refer: kubernetes-sigs/blob-csi-driver#852