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:prevent goroutine leakage for pkg/k8s/watchers #22362

Merged
merged 1 commit into from Jan 19, 2023

Conversation

yulng
Copy link
Contributor

@yulng yulng commented Nov 25, 2022

Use the ctx passed to ciliumClusterwideEnvoyConfigInit instead of wait.NeverStop.
reference #21913

@tommyp1ckles @aanm @joamaki

@yulng yulng requested a review from a team as a code owner November 25, 2022 11:10
@maintainer-s-little-helper
Copy link

Commit 22a0cd3000edea030948482287392cab63031eed does not contain "Signed-off-by".

Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin

@maintainer-s-little-helper maintainer-s-little-helper bot added dont-merge/needs-sign-off The author needs to add signoff to their commits before merge. dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. labels Nov 25, 2022
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-sign-off The author needs to add signoff to their commits before merge. label Nov 25, 2022
@maintainer-s-little-helper
Copy link

Commit d52e29f35457c27e90be0197d16d89a8b3abd964 does not contain "Signed-off-by".

Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin

@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-sign-off The author needs to add signoff to their commits before merge. label Nov 27, 2022
@yulng yulng changed the title Fix:prevent goroutine leakage for pkg/k8s/watchers fix:prevent goroutine leakage for pkg/k8s/watchers Nov 28, 2022
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-sign-off The author needs to add signoff to their commits before merge. label Nov 28, 2022
@joestringer
Copy link
Member

Thanks for the PR. The code doesn't compile right now, so I would suggest that we keep it in draft until you are able to address the CI failures and push a fresh version that passes the initial smoke tests. Then, please mark the PR "Ready for review" and we can take a fresh look.

@joestringer joestringer marked this pull request as draft November 30, 2022 01:42
@maintainer-s-little-helper
Copy link

Commit ae19cbd14a1f493b62557bac6482f7d93e4b8bcb does not contain "Signed-off-by".

Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin

@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-sign-off The author needs to add signoff to their commits before merge. label Nov 30, 2022
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-sign-off The author needs to add signoff to their commits before merge. label Nov 30, 2022
@yulng
Copy link
Contributor Author

yulng commented Nov 30, 2022

Use the ctx passed to ciliumClusterwideEnvoyConfigInit instead of wait.NeverStop. reference #21913

Thanks for the PR. The code doesn't compile right now, so I would suggest that we keep it in draft until you are able to address the CI failures and push a fresh version that passes the initial smoke tests. Then, please mark the PR "Ready for review" and we can take a fresh look.

I pushed again, but CI still failed, how to pass?
thanks

@joestringer
Copy link
Member

Most jobs failed during image pull. The image pull details link shows that the build failed and has the details of the make target failure. It should be reproducible with make locally.

@aanm aanm added the kind/community-contribution This was a contribution made by a community member. label Dec 1, 2022
@maintainer-s-little-helper
Copy link

Commit 7c944970b3f8b39f2c9baa7d45045076ed772721 does not contain "Signed-off-by".

Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin

@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-sign-off The author needs to add signoff to their commits before merge. label Dec 1, 2022
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-sign-off The author needs to add signoff to their commits before merge. label Dec 1, 2022
@yulng yulng changed the title fix:prevent goroutine leakage for pkg/k8s/watchers fix:prevent goroutine leakage for pkg/k8s/watchers(Ready for review) Dec 1, 2022
@yulng
Copy link
Contributor Author

yulng commented Dec 1, 2022

Thanks for the PR. The code doesn't compile right now, so I would suggest that we keep it in draft until you are able to address the CI failures and push a fresh version that passes the initial smoke tests. Then, please mark the PR "Ready for review" and we can take a fresh look.

Ready for review
Thanks
@joestringer

@joestringer
Copy link
Member

I won't look just yet, but just to let you know: To mark a PR ready for review, click this button at the bottom of the page:

image

You can remove the mention in the title, since that title will eventually become a release note.

@joestringer joestringer added the release-note/misc This PR makes changes that have no direct user impact. label Dec 1, 2022
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Dec 1, 2022
@joestringer
Copy link
Member

I marked this as release-note/misc since it looks like this will only ensure that certain goroutines are cleaned up during shutdown, and when that occurs the agent will exit anyway. If you think that there could be any user-facing impact from this PR, please describe how that impact could occur (ideally with some example observations from an environment where you observed this).

@yulng
Copy link
Contributor Author

yulng commented Dec 1, 2022

I marked this as release-note/misc since it looks like this will only ensure that certain goroutines are cleaned up during shutdown, and when that occurs the agent will exit anyway. If you think that there could be any user-facing impact from this PR, please describe how that impact could occur (ideally with some example observations from an environment where you observed this).

I refer to this #21913

@joestringer joestringer marked this pull request as ready for review December 1, 2022 17:35
@joestringer joestringer changed the title fix:prevent goroutine leakage for pkg/k8s/watchers(Ready for review) fix:prevent goroutine leakage for pkg/k8s/watchers Dec 1, 2022
@joestringer
Copy link
Member

I clicked ready for review and renamed the PR per #22362 (comment).

@joestringer
Copy link
Member

I will run CI, then assigned reviewers can take a look.

@joestringer
Copy link
Member

joestringer commented Dec 1, 2022

/test

Job 'Cilium-PR-K8s-1.24-kernel-5.4' hit: #22019 (94.17% similarity)

Job 'Cilium-PR-K8s-1.25-kernel-4.19' hit: #22019 (94.82% similarity)

@yulng
Copy link
Contributor Author

yulng commented Dec 5, 2022

/test

Job 'Cilium-PR-K8s-1.24-kernel-5.4' hit: #22019 (94.17% similarity)

Job 'Cilium-PR-K8s-1.25-kernel-4.19' hit: #22019 (94.82% similarity)

thank you
now it can be merged?
@joestringer

@yulng
Copy link
Contributor Author

yulng commented Dec 6, 2022

I will run CI, then assigned reviewers can take a look.

@tommyp1ckles 😄😄

@tommyp1ckles
Copy link
Contributor

From a function api level, I would say this behaviour might be a bit unintuitive. If I was to change the top level initK8sWatchers call to take a Context with a timeout, my expectation that that would just constrain how long it takes for the init procedure to complete, not how long the k8s controllers end up running for (i.e. if someone changed the global timeout expecting to constraint init times...)

Anyway, I see that this pattern is already being followed so otherwise it lgtm (might be worth adding a note about this behaviour)

@joestringer
Copy link
Member

There are many failures, but the jobs have expired. I would suggest rebasing your PR against master, then we can re-run CI again and try to establish whether CI is identifying code issues with the PR or not.

@yulng
Copy link
Contributor Author

yulng commented Dec 10, 2022

There are many failures, but the jobs have expired. I would suggest rebasing your PR against master, then we can re-run CI again and try to establish whether CI is identifying code issues with the PR or not.

Pushed it again, all CI check pass
Thanks😄
@joestringer

@aanm
Copy link
Member

aanm commented Dec 10, 2022

/test

Job 'Cilium-PR-K8s-1.25-kernel-4.19' hit: #21519 (90.01% similarity)

@yulng
Copy link
Contributor Author

yulng commented Jan 1, 2023

@joestringer
How about this PR?
Thanks

@joestringer
Copy link
Member

joestringer commented Jan 13, 2023

/test

Job 'Cilium-PR-K8s-1.16-kernel-4.9' failed:

Click to show.

Test Name

K8sDatapathConfig Host firewall With VXLAN

Failure Output

FAIL: Failed to reach 192.168.56.11:80 from testserver-host-m4fs6

If it is a flake and a GitHub issue doesn't already exist to track it, comment /mlh new-flake Cilium-PR-K8s-1.16-kernel-4.9 so I can create one.

@joestringer
Copy link
Member

joestringer commented Jan 13, 2023

A couple of tests were still failing, so I clicked the rebase button and re-triggered full CI. Let's see what CI says after that.

Signed-off-by: yulng <wei.yang@daocloud.io>
@yulng
Copy link
Contributor Author

yulng commented Jan 19, 2023

A couple of tests were still failing, so I clicked the rebase button and re-triggered full CI. Let's see what CI says after that.

I rebase and push again ,all CI is ok now

@joestringer
Copy link
Member

Each time you rebase, it hides the results of the last CI run. If we cannot see the results of the CI run, then we cannot merge the PR. I will run the CI again, then we can see whether the CI passes or not. Please hold back on rebasing for now.

@joestringer
Copy link
Member

/test

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Jan 19, 2023
@ldelossa ldelossa merged commit 004eebf into cilium:master Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/community-contribution This was a contribution made by a community member. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants