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

wait.PollUntilContextCancel immediately executes condition once #119762

Merged
merged 3 commits into from
Nov 2, 2023

Conversation

AxeZhan
Copy link
Member

@AxeZhan AxeZhan commented Aug 4, 2023

What type of PR is this?

/kind bug

What this PR does / why we need it:

In #118686, we make sure that wait.PollUntilContextTimeout function, if immediate is true, the condition will be invoked before waiting and guarantees that the condition is invoked at least once, regardless of whether the context has been cancelled. However, the changes in that pr will make new PollUntilContextCancel function immediately executes given condition twice, which is not mentioned anywhere. Which is not semantically same with wait.PollImmediateUntil.

Which issue(s) this PR fixes:

Fixes #119533

Special notes for your reviewer:

Does this PR introduce a user-facing change?

wait.PollUntilContextTimeout function, if immediate is true, the condition will be invoked before waiting and guarantees that the condition is invoked at least once and then wait a interval before executing again.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. kind/bug Categorizes issue or PR as related to a bug. labels Aug 4, 2023
@k8s-ci-robot
Copy link
Contributor

Please note that we're already in Test Freeze for the release-1.28 branch. This means every merged PR will be automatically fast-forwarded via the periodic ci-fast-forward job to the release branch of the upcoming v1.28.0 release.

Fast forwards are scheduled to happen every 6 hours, whereas the most recent run was: Fri Aug 4 10:27:29 UTC 2023.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 4, 2023
@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 4, 2023
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 4, 2023
@AxeZhan
Copy link
Member Author

AxeZhan commented Aug 5, 2023

/cc @aojea

@k8s-ci-robot k8s-ci-robot requested a review from aojea August 5, 2023 04:23
@aojea
Copy link
Member

aojea commented Aug 5, 2023

/assign @aojea @smarterclayton

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 6, 2023
@aojea
Copy link
Member

aojea commented Sep 12, 2023

/assign @liggitt @wojtek-t

@liggitt
Copy link
Member

liggitt commented Sep 12, 2023

I don't have the context (ha) for this in my head, would really like @smarterclayton to review

@smarterclayton
Copy link
Contributor

Some more comments to address.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 13, 2023
@AxeZhan AxeZhan force-pushed the PollUntilContextCancel branch 2 times, most recently from df1a9e1 to 5049847 Compare September 13, 2023 08:13
@smarterclayton
Copy link
Contributor

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 1, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 372a65d63379e879e6f0a8c8fb0581b227907525

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AxeZhan, smarterclayton

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 Nov 1, 2023
@aojea
Copy link
Member

aojea commented Nov 2, 2023

/milestone v1.29

this is a bugfix

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. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

k8s.io/apimachinery/pkg/util/wait.PollUntilContextCancel immediately executes condition twice
8 participants