fix: retry cgroup2/bpf-fs path check to handle mount propagation delay - #1845
bhumikadangayach wants to merge 2 commits into
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @bhumikadangayach! It looks like this is your first PR to kmesh-net/kmesh 🎉 |
Codecov Report✅ All modified and coverable lines are covered by tests. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
7510207 to
6ccea1d
Compare
| retryDelay = 500 * time.Millisecond | ||
| ) | ||
| var err error | ||
| for i := 0; i < maxRetries; i++ { |
There was a problem hiding this comment.
| for i := 0; i < maxRetries; i++ { | |
| for i := 0; i <= maxRetries; i++ { |
Ensure that a retry is attempted even after the last failure
|
The failing E2E appears to be TestCrossNamespace, where the unenrolled workload unexpectedly gets L7 processing (X-Request-Id). TestKmeshRestart passes with 360/360 successful requests. This appears unrelated to the cgroup2/bpf-fs retry change. |
|
Same failure on the IPv6 run too - TestCrossNamespace, unenrolled workload getting X-Request-Id set. Unrelated to this change, only touches daemon/options/bpf.go. |
Signed-off-by: Bhumika Dangayach <139267865+bhumikadangayach@users.noreply.github.com>
Signed-off-by: Bhumika Dangayach <139267865+bhumikadangayach@users.noreply.github.com>
773c075 to
3284f68
Compare
|
This run hit #1911 - tests all passed (TestCrossNamespace, TestKmeshRestart 350/350), suite still exits 1 on log-collection step. Unrelated to this change. |
Fixes #1842
The kmesh-daemon was crashing on startup with "stat /mnt/kmesh_cgroup2: no such file or directory" when running on kind. Traced it to ParseConfig() in daemon/options/bpf.go doing a single os.Stat call with no retry - if the mount isn't ready yet (which happens on kind due to mount propagation delay), it fails immediately instead of waiting.
This PR adds a waitForPath() helper that retries the stat call up to 10 times with 500ms between attempts (5 seconds total) before giving up. Applied to both the cgroup2 path and bpf-fs path checks.
Verified with make build - compiles clean, no errors.