Skip to content

Conversation

@Syspretor
Copy link
Collaborator

Fixes #4455
The following postStartHook will be injected in the fuse-sidecar to check the mount status.

lifecycle:
  postStart:
    exec:
      command: [ "/bin/sh", "-c", "time /check-mount.sh >> /proc/1/fd/1" ]

However, the startup of the Container and the execution of the PostStartHook occur in parallel. it is possible that when the PostStartHook is executed, the PID 1 process inside the container has not completed its startup. This can lead to a failure in redirecting to /proc/1/fd/1 when the PostStartHook runs the check-mount script.

Signed-off-by: jiuyu <guotongyu.gty@alibaba-inc.com>
@fluid-e2e-bot
Copy link

fluid-e2e-bot bot commented Dec 23, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign ronggu for approval by writing /assign @ronggu in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Syspretor Syspretor requested a review from cheyang December 23, 2024 11:46
@sonarqubecloud
Copy link

// https://github.com/kubernetes/kubernetes/issues/25766
cmd := []string{"bash", "-c", fmt.Sprintf("time %s %s %s >> /proc/1/fd/1", appScriptPath, mountPaths, mountTypes)}
// https://github.com/fluid-cloudnative/fluid/issues/4455
cmd := []string{"bash", "-c", fmt.Sprintf("while [ ! -e /proc/1/fd/1 ]; do sleep 1; done; bash -c 'time %s %s %s >> /proc/1/fd/1'", appScriptPath, mountPaths, mountTypes)}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest adding a timeout to avoid potential infinite loops in case of unexpected conditions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] A probabilistic failure of check-mount script redirection in PreStartHook occurs due to slow startup of the Fuse container.

2 participants