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

Drop the tracker. #4111

Merged
merged 1 commit into from
Jul 22, 2021
Merged

Drop the tracker. #4111

merged 1 commit into from
Jul 22, 2021

Conversation

mattmoor
Copy link
Member

Changes

Tekton's use of the tracker is redundant with the informer events it already has configured, and the tracker lease the pipeline run controller is using is probably too small to actually be effective for long-running pipelines.

The tracker is built around the premise that resyncs happen to "refresh" things, and so to be safe the tracker lease should be a multiple of the resync period. The pipeline controller is currently hardcoding 30m, but the default resync period is 10h, so anything taking longer than 30m via the tracker will actually drop events. The controller also seems to track a TaskRun with the name of the PipelineRun, which also feels wrong... 🤔

Fortunately, I believe that both usages of the tracker are wholly redundant with informer events on owned resources anyhow, so this change should just remove unneeded complexity.

For additional background, the purpose of the tracked isn't to track owned resources, but rather to track resources referenced via corev1.ObjectReference (or equivalent). We use this in Knative to track changes to Addressable resources that some resource might be delivering events to (e.g. maybe the address changed, or it is no longer Ready).

/kind cleanup

Submitter Checklist

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

  • Docs included if any changes are user facing
  • Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including
    functionality, content, code)
  • Release notes block below has been filled in or deleted (only if no user facing changes)

Release Notes

NONE

cc @dlorenc @imjasonh @vdemeester @afrittoli

@tekton-robot tekton-robot added release-note-none Denotes a PR that doesnt merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Jul 21, 2021
@tekton-robot tekton-robot requested review from afrittoli and dibyom July 21, 2021 16:18
@tekton-robot tekton-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 21, 2021
@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/reconciler/pipelinerun/pipelinerun.go 83.1% 83.4% 0.3
pkg/reconciler/taskrun/controller.go 96.4% 96.3% -0.1
pkg/reconciler/taskrun/taskrun.go 76.9% 77.3% 0.4

Tekton's use of the `tracker` is redundant with the informer events it already has configured, and the tracker lease the pipeline run controller is using is probably too small to actually be effective for long-running pipelines.

The tracker is built around the premise that resyncs happen to "refresh" things, and so to be safe the tracker lease should be a multiple of the resync period.  The pipeline controller is currently hardcoding `30m`, but the default resync period is `10h`, so anything taking longer than `30m` via the tracker will actually drop events.

Fortunately, I believe that both usages of the tracker are wholly redundant with informer events on owned resources anyhow, so this change should just remove unneeded complexity.

For additional background, the purpose of the tracked isn't to track owned resources, but rather to track resources referenced via `corev1.ObjectReference` (or equivalent).  We use this in Knative to track changes to Addressable resources that some resource might be delivering events to (e.g. maybe the address changed, or it is no longer Ready).
@mattmoor
Copy link
Member Author

Rebased this on #4110 which just landed.

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/reconciler/pipelinerun/pipelinerun.go 83.1% 83.4% 0.3
pkg/reconciler/taskrun/controller.go 96.4% 96.3% -0.1
pkg/reconciler/taskrun/taskrun.go 76.9% 77.3% 0.4

@mattmoor
Copy link
Member Author

/test check-pr-has-kind-label

1 similar comment
@mattmoor
Copy link
Member Author

/test check-pr-has-kind-label

Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

Seems good to me 😉

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vdemeester

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

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 22, 2021
Copy link
Member

@afrittoli afrittoli left a comment

Choose a reason for hiding this comment

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

Thanks!
Going back all the way to #757, this is the first reference of the tracker that I see, but it was in a different place in the code, and it does not seem to be applicable anymore - today a Pipeline is not marked as done until all associated TaskRun have finished execution in some way.

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 22, 2021
@tekton-robot tekton-robot merged commit b15f25e into tektoncd:main Jul 22, 2021
@mattmoor mattmoor deleted the drop-tracker branch July 22, 2021 16: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. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesnt merit a release note. 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.

4 participants