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 cacheWatcher leak when time jump to the future and jump back #96266

Merged
merged 1 commit into from Nov 14, 2020

Conversation

chenyw1990
Copy link
Contributor

@chenyw1990 chenyw1990 commented Nov 5, 2020

What type of PR is this?
/kind bug

What this PR does / why we need it:
Fix cacheWatcher leak when time jump to the future and jump back

Which issue(s) this PR fixes:
#96259

Fix memory leak in kube-apiserver when underlying time goes forth and back.

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 5, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @chenyw1990. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/apiserver sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Nov 5, 2020
@fedebongio
Copy link
Contributor

/triage accepted
/assign @wojtek-t
(thank you!)

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 5, 2020
@gongguan
Copy link
Contributor

gongguan commented Nov 8, 2020

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 8, 2020
@wojtek-t
Copy link
Member

wojtek-t commented Nov 8, 2020

/hold

I would like to first understand how exactly that may happen to ensure that fix is what we want - pending answer on: #96259 (comment)

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 8, 2020
@chenyw1990
Copy link
Contributor Author

/retest

@liggitt
Copy link
Member

liggitt commented Nov 9, 2020

Rather than add a mechanism like this, can we modify the existing time calculations to make use of the golang monotonic clock, which is not affected by forward/backward changes in wall clock time?

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 12, 2020
@chenyw1990
Copy link
Contributor Author

@liggitt @wojtek-t @gongguan
I have refactored the code using golang's monotonic clock feature and have passed the test in our product.
review please.

@wojtek-t wojtek-t removed sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. sig/network Categorizes an issue or PR as relevant to SIG Network. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/release Categorizes an issue or PR as relevant to SIG Release. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. sig/storage Categorizes an issue or PR as relevant to SIG Storage. sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Nov 13, 2020
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Nov 13, 2020
@wojtek-t
Copy link
Member

/lgtm
/approve
/hold cancel

/milestone v1.20
[Adding milestone as this is bug fix - we will be cherrypicking back once this merges]

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 13, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.20 milestone Nov 13, 2020
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 13, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chenyw1990, wojtek-t

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 13, 2020
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

1 similar comment
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@chenyw1990
Copy link
Contributor Author

/retest

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Nov 14, 2020

@chenyw1990: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-publishing-bot-validate 29759dcdcb802564aabb4187f6ff1e0472f18ebd link /test pull-publishing-bot-validate
pull-kubernetes-local-e2e 29759dcdcb802564aabb4187f6ff1e0472f18ebd link /test pull-kubernetes-local-e2e
pull-kubernetes-conformance-kind-ipv6-parallel 29759dcdcb802564aabb4187f6ff1e0472f18ebd link /test pull-kubernetes-conformance-kind-ipv6-parallel
pull-kubernetes-e2e-gce-iscsi-serial 29759dcdcb802564aabb4187f6ff1e0472f18ebd link /test pull-kubernetes-e2e-gce-iscsi-serial
pull-kubernetes-e2e-azure-file 29759dcdcb802564aabb4187f6ff1e0472f18ebd link /test pull-kubernetes-e2e-azure-file
pull-kubernetes-files-remake 29759dcdcb802564aabb4187f6ff1e0472f18ebd link /test pull-kubernetes-files-remake
pull-kubernetes-e2e-gce-alpha-features 29759dcdcb802564aabb4187f6ff1e0472f18ebd link /test pull-kubernetes-e2e-gce-alpha-features
pull-kubernetes-e2e-azure-disk-windows 29759dcdcb802564aabb4187f6ff1e0472f18ebd link /test pull-kubernetes-e2e-azure-disk-windows
pull-kubernetes-e2e-gce-storage-snapshot 29759dcdcb802564aabb4187f6ff1e0472f18ebd link /test pull-kubernetes-e2e-gce-storage-snapshot
pull-kubernetes-e2e-gce-iscsi 29759dcdcb802564aabb4187f6ff1e0472f18ebd link /test pull-kubernetes-e2e-gce-iscsi
pull-kubernetes-e2e-gce-csi-serial 29759dcdcb802564aabb4187f6ff1e0472f18ebd link /test pull-kubernetes-e2e-gce-csi-serial
pull-kubernetes-conformance-image-test 29759dcdcb802564aabb4187f6ff1e0472f18ebd link /test pull-kubernetes-conformance-image-test
pull-kubernetes-e2e-aks-engine-azure 29759dcdcb802564aabb4187f6ff1e0472f18ebd link /test pull-kubernetes-e2e-aks-engine-azure
pull-kubernetes-e2e-azure-disk-vmss 29759dcdcb802564aabb4187f6ff1e0472f18ebd link /test pull-kubernetes-e2e-azure-disk-vmss
pull-kubernetes-e2e-azure-disk 29759dcdcb802564aabb4187f6ff1e0472f18ebd link /test pull-kubernetes-e2e-azure-disk
pull-kubernetes-e2e-gce-storage-slow 29759dcdcb802564aabb4187f6ff1e0472f18ebd link /test pull-kubernetes-e2e-gce-storage-slow
pull-kubernetes-e2e-azure-file-windows 29759dcdcb802564aabb4187f6ff1e0472f18ebd link /test pull-kubernetes-e2e-azure-file-windows

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@chenyw1990
Copy link
Contributor Author

/retest

@k8s-ci-robot k8s-ci-robot merged commit afb2342 into kubernetes:master Nov 14, 2020
k8s-ci-robot added a commit that referenced this pull request Nov 17, 2020
…66-upstream-release-1.17

Automated cherry pick of #96266 upstream release 1.17
k8s-ci-robot added a commit that referenced this pull request Nov 17, 2020
…66-upstream-release-1.19

Automated cherry pick of #96266 upstream release 1.19
k8s-ci-robot added a commit that referenced this pull request Nov 17, 2020
…66-upstream-release-1.18

Automated cherry pick of #96266 upstream release 1.18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/apiserver cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants