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

Trimaran common function minor bug fix #636

Open
1 of 4 tasks
knarayan opened this issue Sep 7, 2023 · 7 comments
Open
1 of 4 tasks

Trimaran common function minor bug fix #636

knarayan opened this issue Sep 7, 2023 · 7 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@knarayan
Copy link
Contributor

knarayan commented Sep 7, 2023

Area

  • Scheduler
  • Controller
  • Helm Chart
  • Documents

Other components

No response

What happened?

This issue fixes below minor bugs found during code walk through:

  1. Bug-1: Trimaran handler.go function OnDelete() needs to delete a node from ScheduledPodsCache if the pod being deleted is the last one associated with that node.

  1. Bug-2: Trimaran handler.go function cleanupCache() deletes older entries. The variable idx represents the index of the first element whose timestamp is within the current interval (assuming the entries are in ascending order of timestamps). When idx == len(cache), all the entries are to be deleted as it indicates that all the elements are older. However, the code currently doesn't delete any element if all the entries are older.

if idx == len(cache) {

What did you expect to happen?

The issues above are functionality bugs.

  1. If we don't fix the cleaning the cache entry map as part of the Bug-1 reported above, then it results into not optimally managing the cache map.

Function TestHandlerCacheAddUpdateDelete with test cases is added to scheduler-plugins/pkg/trimaran/handler_test.go to exercise this. The test cases in this function will fail without this source code change.

  1. If we don't change the if condition idx == len(cache) to address the Bug-2 reported above, then entries outside of the current interval continue to be part of the cache.

cleanupCache_deletes_old_pods_and_node_entry_with_empty_cache added to the function TestHandlerCacheCleanup() of scheduler-plugins/pkg/trimaran/handler_test.go to exercise this scenario will fail without this source code change.

How can we reproduce it (as minimally and precisely as possible)?

Test cases were added to reproduce these issues. Without the changes to the file scheduler-plugins/pkg/trimaran/handler.go, the test cases that are added as specified above will fail.

Anything else we need to know?

No response

Kubernetes version

$ kubectl version
# paste output here

Scheduler Plugins version

@knarayan knarayan added the kind/bug Categorizes issue or PR as related to a bug. label Sep 7, 2023
@Huang-Wei
Copy link
Contributor

/assign @atantawi @wangchen615

could you please help take a look at the issue and PR?

@k8s-ci-robot
Copy link
Contributor

@Huang-Wei: GitHub didn't allow me to assign the following users: atantawi.

Note that only kubernetes-sigs members with read permissions, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

/assign @atantawi @wangchen615

could you please help take a look at the issue and 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.

@atantawi
Copy link
Contributor

/assign @atantawi

@k8s-triage-robot
Copy link

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

This bot triages un-triaged issues 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 as fresh with /remove-lifecycle stale
  • Close this issue 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 Jan 28, 2024
@Huang-Wei
Copy link
Contributor

/remove-lifecycle stale

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

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

This bot triages un-triaged issues 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 as fresh with /remove-lifecycle stale
  • Close this issue 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 Apr 27, 2024
@k8s-triage-robot
Copy link

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

This bot triages un-triaged issues 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 as fresh with /remove-lifecycle rotten
  • Close this issue 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 May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants