Skip to content

[release-v1.0.x] adding efficient polling to waitForStepsToFinish#8913

Merged
tekton-robot merged 2 commits intotektoncd:release-v1.0.xfrom
pritidesai:cherrypick-8901-1.0
Aug 14, 2025
Merged

[release-v1.0.x] adding efficient polling to waitForStepsToFinish#8913
tekton-robot merged 2 commits intotektoncd:release-v1.0.xfrom
pritidesai:cherrypick-8901-1.0

Conversation

@pritidesai
Copy link
Member

@pritidesai pritidesai commented Jul 24, 2025

Changes

Manual Cherry-pick of #8901

#8901 (comment)

Closing auto-generated PR due to linter issues - #8910

/kind bug

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Has Docs if any changes are user facing, including updates to minimum requirements e.g. Kubernetes version bumps
  • Has Tests included if any functionality added or changed
  • pre-commit Passed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including functionality, content, code)
  • Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings). See some examples of good release notes.
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

The log results sidecar has been optimized to significantly reduce CPU utilization.  Operators can tune the system for their environment—using a higher interval to reduce CPU load in production, or a lower interval for faster feedback in development or testing.

@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. labels Jul 24, 2025
@tekton-robot tekton-robot requested review from jerop and vdemeester July 24, 2025 22:00
@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 24, 2025
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/pod/pod.go 93.4% 93.3% -0.1

@waveywaves
Copy link
Member

/retest

@waveywaves
Copy link
Member

/kind bug

@waveywaves
Copy link
Member

@pritidesai can you rebase the PR the CI should be fixed after :)

The current waitForStepsToFinish implementation is a classic busy-wait.
It checks for file existence without any sleep, resulting in a high
CPU usage. Adding a profile with a unit test to show that almost all
time is spent in system calls with a high total sample count. This led to
execssive CPU usage by the sidecar even when just waiting.

The function now sleeps 100ms between checks, drastically reducing the
frequency. The sidecar now uses minimal CPU while waiting.

Signed-off-by: Priti Desai <pdesai@us.ibm.com>
Introducing getSidecarLogPollingInterval() to avoid repeating the same
logic across two different functions.

Signed-off-by: Priti Desai <pdesai@us.ibm.com>
@pritidesai pritidesai force-pushed the cherrypick-8901-1.0 branch from b61fcf9 to 2767bd7 Compare August 1, 2025 20:29
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/pod/pod.go 93.4% 93.3% -0.1

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/pod/pod.go 93.4% 93.3% -0.1

@pritidesai
Copy link
Member Author

@pritidesai can you rebase the PR the CI should be fixed after :)

I am so sorry @waveywaves, I just saw your comment. This is ready to merge now. Thanks!

Copy link
Member

@waveywaves waveywaves left a comment

Choose a reason for hiding this comment

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

/lgtm
/meow

@tekton-robot
Copy link
Collaborator

@waveywaves: cat image

Details

In response to this:

/lgtm
/meow

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.

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 1, 2025
Copy link
Member

@waveywaves waveywaves left a comment

Choose a reason for hiding this comment

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

/approve

@waveywaves waveywaves added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 14, 2025
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by: waveywaves

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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

@tekton-robot tekton-robot merged commit f942587 into tektoncd:release-v1.0.x Aug 14, 2025
18 checks passed
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. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants