-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
informer: fix race against Run and SetTransform/SetWatchErrorHandler #117870
informer: fix race against Run and SetTransform/SetWatchErrorHandler #117870
Conversation
/assign @dinhxuanvu |
@cici37: GitHub didn't allow me to assign the following users: dinhxuanvu. Note that only kubernetes 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. In response to this:
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. |
/assign @dinhxuanvu |
@howardjohn: GitHub didn't allow me to assign the following users: dinhxuanvu. Note that only kubernetes 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. In response to this:
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. |
@howardjohn I'm working on it. No worries. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, lgtm. Just a tiny nit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
@dinhxuanvu: changing LGTM is restricted to collaborators In response to this:
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. |
Transformer: s.transform, | ||
}) | ||
|
||
cfg = &Config{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cfg = &Config{ | |
cfg := &Config{ |
No references outside of this anonymous function right?
Squash for merge please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, good catch. Fixed + squashed
`SetWatchErrorHandler` claims it will fail if Run() has already started. But if they are called concurrently, it will actually trigger a data race. With this PR: ``` 62702 runs so far, 0 failures (100.00% pass rate). 59.152682ms avg, 189.068387ms max, 26.623785ms min ``` Without this PR: ``` 5012 runs so far, 38 failures (99.25% pass rate). 58.675502ms avg, 186.018084ms max, 29.468104ms min ```
d04c83d
to
35d2431
Compare
/lgtm |
LGTM label has been added. Git tree hash: 5990ff79be68a130cb349ecf4a2917be4371a9f4
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k, dinhxuanvu, howardjohn 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 |
/test pull-kubernetes-e2e-gce |
What type of PR is this?
/kind bug
What this PR does / why we need it:
SetWatchErrorHandler
claims it will fail if Run() has already started. But if they are called concurrently, it will actually trigger a data race.With this PR:
Without this PR:
Which issue(s) this PR fixes:
For #117869, but does not fix
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: