Skip to content
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 bpfloglevel update error bug in Ads mode. #483

Merged
merged 2 commits into from
Jul 5, 2024

Conversation

bfforever
Copy link
Member

What type of PR is this?
/kind bug

What this PR does / why we need it:

Which issue(s) this PR fixes:
Fixes #477

Special notes for your reviewer:

[root@master ~]#  kubectl exec -it nettool -- curl helloworld-d.default.svc.cluster.local:5000/hello
Hello version: v2, instance: helloworld-v2-654d97458-pmxk6
time="2024-07-03T12:44:55Z" level=info msg="[KMESH] DEBUG: bpf find listener addr=[10.104.111.255:5000]\n" subsys=ebpf
time="2024-07-03T12:44:55Z" level=info msg="[CLUSTER] INFO: cluster=\"outbound|5000||helloworld.default.svc.cluster.local\", loadbalance to addr=[172.16.219.112:5000]\n" subsys=ebpf

Does this PR introduce a user-facing change?:


Signed-off-by: kangmingfa <1640528278@qq.com>
@kmesh-bot kmesh-bot added the kind/bug Something isn't working label Jul 3, 2024
Signed-off-by: kangmingfa <1640528278@qq.com>
@@ -295,7 +294,7 @@ func (s *Server) bpfLogLevel(w http.ResponseWriter, r *http.Request) {
}
key := uint32(0)
levelPtr := uint32(level)
if err := s.bpfWorkloadObj.SockConn.BpfLogLevel.Update(&key, &levelPtr, ebpf.UpdateAny); err != nil {
if err := s.bpfLogLevelMap.Update(&key, &levelPtr, ebpf.UpdateAny); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

Safer way is to check whether bpfLogLevelMap is nil. Kmesh maybe started only with bypass

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Copy link
Member

@hzxuzhonghu hzxuzhonghu left a comment

Choose a reason for hiding this comment

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

/lgtm

@kmesh-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hzxuzhonghu

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 c78488f into kmesh-net:main Jul 5, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kmesh panic when change bpfloglevel
3 participants