Skip to content

Conversation

@Syspretor
Copy link
Collaborator

@Syspretor Syspretor commented Oct 27, 2025

In the serverless environment, Fluid injects Fuse as a sidecar into the application pod and sets a check-mount.sh script as a postStart hook to check the mount point status inside the sidecar. For easier troubleshooting, the execution output of check-mount.sh is redirected to the container’s standard output, as shown below.

    lifecycle:
      postStart:
        exec:
          command:
          - bash
          - -c
          - 'time /check-mount.sh /jfs jindo  >>/pro/1/fd/1'

However, because postStart and the container process startup are not serialized, the redirection may fail, causing the Fuse container to crash and restart. This PR moves the redirection into the check-mount.sh script itself and adds a retry mechanism.

@Syspretor Syspretor changed the title Fix: support retries for redirecting check-mount script execution res… [WIP] Fix: support retries for redirecting check-mount script execution res… Oct 27, 2025
…ult to stdout.

Signed-off-by: 玖宇 <guotongyu.gty@alibaba-inc.com>
@RongGu RongGu requested a review from Copilot October 27, 2025 06:50
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR modifies the postStartHook script generation to improve reliability of output redirection by implementing a retry mechanism. The changes move output redirection from the command invocation level into the script itself with retry logic.

Key Changes:

  • Added a redirect_output_with_retry() function that attempts output redirection up to 5 times with 1-second delays between attempts
  • Removed the >> /proc/1/fd/1 redirection from the command string, as redirection now happens within the script

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pkg/application/inject/fuse/poststart/check_fuse_default.go Added retry logic for output redirection in the privileged sidecar script and removed redirection from command invocation
pkg/application/inject/fuse/poststart/check_fuse_app.go Added retry logic for output redirection in the app mount check script and removed redirection from command invocation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Syspretor Syspretor force-pushed the fix/add-retry-for-webhook-poststart-script branch from 4b34e04 to d45d173 Compare October 27, 2025 06:51
@sonarqubecloud
Copy link

@RongGu RongGu requested a review from Copilot October 27, 2025 06:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Oct 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.24%. Comparing base (a42f1d8) to head (d45d173).
⚠️ Report is 70 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5297      +/-   ##
==========================================
+ Coverage   55.77%   57.24%   +1.46%     
==========================================
  Files         413      412       -1     
  Lines       28087    27465     -622     
==========================================
+ Hits        15666    15722      +56     
+ Misses      11006    10322     -684     
- Partials     1415     1421       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Syspretor Syspretor changed the title [WIP] Fix: support retries for redirecting check-mount script execution res… Fix: support retries for redirecting check-mount script execution res… Oct 27, 2025
@Syspretor Syspretor marked this pull request as ready for review October 27, 2025 08:03
Copy link
Collaborator

@cheyang cheyang left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@cheyang cheyang merged commit 29e1c1e into fluid-cloudnative:master Oct 28, 2025
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants