Navigation Menu

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

auto-pause: Using time.Ticker instead of time.Timer to fire idle time-out event. #10700

Closed
wants to merge 2 commits into from

Conversation

hetong07
Copy link
Contributor

@hetong07 hetong07 commented Mar 3, 2021

Fix #10596

Using time.Ticker to replace time.Timer to solve the timer memory leak issue. Refer to this blog for more details.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 3, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @hetong07. 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 the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Mar 3, 2021
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@hetong07
Copy link
Contributor Author

hetong07 commented Mar 3, 2021

@medyagh Do we need to wrap the idleTimer and its parameter check into a helper function? Feel like we can let PR for #10595 to make this decision?

Another question is I tried the auto-pause feature, but I notice after 1 minutes only the kubelet stopped, the apiserver is still running, shown below.

$ ./out/minikube status                                                                                                   
minikube
type: Control Plane
host: Running
kubelet: Stopped
apiserver: Running
kubeconfig: Configured
timeToStop: Nonexistent

This behavior is different than the description in your original PR #10427 , is this behavior intended?

@medyagh
Copy link
Member

medyagh commented Mar 3, 2021

@medyagh Do we need to wrap the idleTimer and its parameter check into a helper function? Feel like we can let PR for #10595 to make this decision?

Another question is I tried the auto-pause feature, but I notice after 1 minutes only the kubelet stopped, the apiserver is still running, shown below.

$ ./out/minikube status                                                                                                   
minikube
type: Control Plane
host: Running
kubelet: Stopped
apiserver: Running
kubeconfig: Configured
timeToStop: Nonexistent

This behavior is different than the description in your original PR #10427 , is this behavior intended?

@hetong07 on my machine it works (mac docker driver)

``
$ minikube addons enable auto-pause
▪ Using image gcr.io/haproxy:2.3.5
▪ auto-pause addon is an alpha feature and still in early development. Please file issues to help us make it better.
co/auto-pause
🌟 The 'auto-pause' addon is enabled

$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c94347742976 gcr.io/k8s-minikube/kicbase:v0.0.18 "/usr/local/bin/entr…" 4 minutes ago Up 4 minutes 127.0.0.1:55034->22/tcp, 127.0.0.1:55033->2376/tcp, 127.0.0.1:55032->5000/tcp, 127.0.0.1:55031->8443/tcp, 127.0.0.1:55030->32443/tcp minikube
10:32:38 medya/workspace/minikube
pod_preset •3 ⌅1
$ code ~/.kube/config
10:33:27 medya/workspace/minikube
pod_preset •3 ⌅1
$ minikube status
minikube
type: Control Plane
host: Running
kubelet: Stopped
apiserver: Paused
kubeconfig: Configured
timeToStop: Nonexistent

@medyagh medyagh changed the title Using time.Ticker instead of time.Timer to fire idle time-out event. auto-pause: Using time.Ticker instead of time.Timer to fire idle time-out event. Mar 3, 2021
Copy link
Contributor

@ilya-zuyev ilya-zuyev left a comment

Choose a reason for hiding this comment

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

Please reset the ticker after each 'unpause' event

@hetong07
Copy link
Contributor Author

hetong07 commented Mar 4, 2021

@medyagh strange, I repeadly see the API service running, maybe configuration issue?

$ ./out/minikube status                                                                                                    
minikube
type: Control Plane
host: Running
kubelet: Stopped
apiserver: Running
kubeconfig: Configured
timeToStop: Nonexistent

@hetong07 hetong07 requested a review from ilya-zuyev March 4, 2021 08:29
@azhao155
Copy link
Contributor

@medyagh @ilya-zuyev why do we need to reset ticker? according to the blog. it should be reset by itself:

"It is good to use the ticker timer directly, because the ticker is executed once every certain period of time. Generally, it can be executed multiple times, which is equivalent to calling timer timer time.Reset ."

@hetong07
Copy link
Contributor Author

@medyagh @ilya-zuyev why do we need to reset ticker? according to the blog. it should be reset by itself:

"It is good to use the ticker timer directly, because the ticker is executed once every certain period of time. Generally, it can be executed multiple times, which is equivalent to calling timer timer time.Reset ."

I think we have to reset it due to the racing conditions, as @ilya-zuyev stated in previous comments.

@k8s-ci-robot
Copy link
Contributor

@hetong07: PR needs rebase.

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 the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 6, 2021
Copy link
Contributor

@ilya-zuyev ilya-zuyev left a comment

Choose a reason for hiding this comment

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

lgtm, could you rebase this PR and we can merge it

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hetong07, ilya-zuyev

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 May 6, 2021
@ilya-zuyev
Copy link
Contributor

/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 May 6, 2021
@k8s-ci-robot
Copy link
Contributor

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

Test name Commit Details Rerun command
pull-minikube-build 00526e1 link /test pull-minikube-build

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.

@andriyDev
Copy link
Contributor

@hetong07 Unsure if you're still around, we'd love to merge this PR. We just need it to be rebased! If we don't hear from you in a few days, I may just take ownership of this PR (creating a new PR with the same content).

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 28, 2021
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Oct 28, 2021
@spowelljr spowelljr added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. labels Nov 3, 2021
@k8s-triage-robot
Copy link

The lifecycle/frozen label can not be applied to PRs.

This bot removes lifecycle/frozen from PRs because:

  • Commenting /lifecycle frozen on a PR has not worked since March 2021
  • PRs that remain open for >150 days are unlikely to be easily rebased

You can:

  • Rebase this PR and attempt to get it merged
  • Close this PR with /close

Please send feedback to sig-contributor-experience at kubernetes/community.

/remove-lifecycle frozen

@k8s-ci-robot k8s-ci-robot removed the lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. label Nov 3, 2021
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 1, 2022
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Mar 3, 2022
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

@k8s-ci-robot
Copy link
Contributor

@k8s-triage-robot: Closed this PR.

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

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.

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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

auto-pause: make it memory-leak proof
9 participants