Skip to content

Fix: unexpected log when pod is shutting down #1383

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

Merged
merged 2 commits into from
May 9, 2025

Conversation

hzxuzhonghu
Copy link
Member

@hzxuzhonghu hzxuzhonghu commented May 9, 2025

What type of PR is this?

What this PR does / why we need it:

For #1381

eliminate these logs during pod shutdown

time="2025-05-09T01:32:09Z" level=info msg="default/ws-server: enable Kmesh manage" subsys=manage_controller
time="2025-05-09T01:32:09Z" level=info msg="add annotation for pod default/ws-server" subsys=manage_controller
time="2025-05-09T01:32:09Z" level=info msg="default/ws-client: enable Kmesh manage" subsys=manage_controller
time="2025-05-09T01:32:09Z" level=info msg="add annotation for pod default/ws-client" subsys=manage_controller
// this is because the connection is established before kmesh starts
time="2025-05-09T01:32:39Z" level=info msg="[PROBE] ERR: on close: bpf_sk_storage_get failed\n" subsys=ebpf

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


…torage is not created, so remove the error logging

Signed-off-by: Zhonghu Xu <[email protected]>
@Copilot Copilot AI review requested due to automatic review settings May 9, 2025 03:38
@kmesh-bot kmesh-bot requested review from kwb0523 and nlgwcy May 9, 2025 03:38
Copy link

@Copilot 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 removes unnecessary logging during pod shutdown and adjusts the behavior of BPF probe functions to suppress expected errors.

  • In the controller, a pod deletion check is added in handlePodUpdate and log level in enableKmeshManage is changed to Debug.
  • In the probe code, the construct_orig_dst_info API is updated to require an external storage parameter and the error logging in observe_on_close/observe_on_data is suppressed.

Reviewed Changes

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

File Description
pkg/controller/manage/manage_controller.go Added pod deletion check and changed log level to Debug to avoid noisy logs.
bpf/kmesh/probes/tcp_probe.h Modified the construct_orig_dst_info signature to require a storage parameter.
bpf/kmesh/probes/probe.h Suppressed error logging in sock storage retrieval scenarios with clarifying comments.
Comments suppressed due to low confidence (1)

bpf/kmesh/probes/tcp_probe.h:112

  • The construct_orig_dst_info function signature now requires an external storage parameter. Ensure that all callers pass a valid non-null storage object to prevent potential runtime issues.
static inline void construct_orig_dst_info(struct bpf_sock *sk, struct sock_storage_data *storage, struct tcp_probe_info *info)

Copy link

codecov bot commented May 9, 2025

Codecov Report

Attention: Patch coverage is 20.00000% with 8 lines in your changes missing coverage. Please review.

Project coverage is 46.21%. Comparing base (77a6ac8) to head (3dc6d64).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
pkg/controller/manage/manage_controller.go 20.00% 6 Missing and 2 partials ⚠️
Files with missing lines Coverage Δ
pkg/controller/manage/manage_controller.go 52.81% <20.00%> (-1.04%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9ef41e7...3dc6d64. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@LiZhenCheng9527
Copy link
Contributor

/lgtm
/approve

@kmesh-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: LiZhenCheng9527

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

The pull request process is described 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

@kmesh-bot kmesh-bot merged commit ed69807 into kmesh-net:main May 9, 2025
11 checks passed
@kmesh-bot
Copy link
Collaborator

In response to a cherrypick label: new pull request created: #1385

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.

3 participants