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

Bug 1917367: Refactor periodic.go #302

Merged
merged 10 commits into from
Jan 19, 2021

Conversation

0sewa0
Copy link
Contributor

@0sewa0 0sewa0 commented Jan 6, 2021

Refactors periodic.go in a way that it doesn't use overly complicated workload management (it should be the responsibility of the gatherers to manage the workloads) and as it was written ~2 years ago and wasn't changed since so it doesn't fit how the actual codebase developed since then. (we only have 1 Gatherer but that has multiple independent gather functions, yet periodic.go tries to manage multiple Gatherers)

Categories

  • Bugfix
  • Enhancement
  • Backporting
  • Others (CI, Infrastructure, Documentation)

Sample archive

  • Shouldn't change

Documentation

  • TBD

Unit Tests

  • TBD

Privacy

Has no effect on privacy

References

None

@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 6, 2021
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 6, 2021
@0sewa0 0sewa0 force-pushed the Refactor_periodic_go branch from 44d58b4 to 81eacb7 Compare January 12, 2021 10:54
@0sewa0 0sewa0 changed the title WIP: Refactor periodic.go Refactor periodic.go Jan 13, 2021
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 13, 2021
@0sewa0
Copy link
Contributor Author

0sewa0 commented Jan 13, 2021

/retest

defer closeFn()

interval := c.config.Config().Interval
if c.initialDelay > 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if the initialDelay = 0? Will the gathering be executed immediately? It doesn't seem so....but maybe I am missing something

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep. It looks weird. AFIK, the Gather will not be executed if the initialDelay is less or eq to zero. I think that this behavior is not desired. Can we put some default value for it?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@0sewa0 0sewa0 Jan 18, 2021

Choose a reason for hiding this comment

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

or do we want to start a gather immediately if no initialDelay is set ?

Copy link
Contributor

Choose a reason for hiding this comment

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

@0sewa0 yes I think so

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated it
it should run a gather immediately if initialDelay is 0 or less

Copy link
Contributor

Choose a reason for hiding this comment

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

thanks

defer closeFn()

interval := c.config.Config().Interval
if c.initialDelay > 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Yep. It looks weird. AFIK, the Gather will not be executed if the initialDelay is less or eq to zero. I think that this behavior is not desired. Can we put some default value for it?

@0sewa0
Copy link
Contributor Author

0sewa0 commented Jan 14, 2021

/retest

@0sewa0 0sewa0 force-pushed the Refactor_periodic_go branch from dbe8cc5 to edaf512 Compare January 14, 2021 08:07
@0sewa0
Copy link
Contributor Author

0sewa0 commented Jan 14, 2021

/retest

3 similar comments
@0sewa0
Copy link
Contributor Author

0sewa0 commented Jan 14, 2021

/retest

@0sewa0
Copy link
Contributor Author

0sewa0 commented Jan 14, 2021

/retest

@0sewa0
Copy link
Contributor Author

0sewa0 commented Jan 14, 2021

/retest

@0sewa0 0sewa0 changed the title Refactor periodic.go Bug 1917367: Refactor periodic.go Jan 18, 2021
@openshift-ci-robot openshift-ci-robot added bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Jan 18, 2021
@openshift-ci-robot
Copy link
Contributor

@0sewa0: This pull request references Bugzilla bug 1917367, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.7.0) matches configured target release for branch (4.7.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1917367: Refactor periodic.go

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.

@0sewa0
Copy link
Contributor Author

0sewa0 commented Jan 19, 2021

/retest

5 similar comments
@0sewa0
Copy link
Contributor Author

0sewa0 commented Jan 19, 2021

/retest

@0sewa0
Copy link
Contributor Author

0sewa0 commented Jan 19, 2021

/retest

@0sewa0
Copy link
Contributor Author

0sewa0 commented Jan 19, 2021

/retest

@0sewa0
Copy link
Contributor Author

0sewa0 commented Jan 19, 2021

/retest

@0sewa0
Copy link
Contributor Author

0sewa0 commented Jan 19, 2021

/retest

@tremes
Copy link
Contributor

tremes commented Jan 19, 2021

I experimented with that locally and it seems to work OK. Thanks
/lgtm

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 0sewa0, tremes

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

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 19, 2021
@openshift-merge-robot openshift-merge-robot merged commit 2bbd615 into openshift:master Jan 19, 2021
@openshift-ci-robot
Copy link
Contributor

@0sewa0: All pull requests linked via external trackers have merged:

Bugzilla bug 1917367 has been moved to the MODIFIED state.

In response to this:

Bug 1917367: Refactor periodic.go

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. bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants