-
Notifications
You must be signed in to change notification settings - Fork 238
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
Fix the race condition on closing eventC #1726
Conversation
Fixes tektoncd#1650 The "defer close(eventC)" results in a race condition with the Informer. This wraps channel operations with a mutex and checks stopC before sending on eventC. Adding the mutex is slightly slower than a channel alone. Other options include skipping the close on eventC which would leak memory. Ideally, the Informer would close the channel when stopping. Signed-off-by: Brandon Mitchell <git@bmitch.net>
Hi @sudo-bmitch. Thanks for your PR. I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/ok-to-test |
Waiting on a fix to tektoncd/pipeline#5537 |
/retest |
2 similar comments
/retest |
/retest |
/lgtm |
/approve |
[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 |
Signed-off-by: Brandon Mitchell git@bmitch.net
Changes
Fixes #1650, alternative to #1722.
This fixes a race condition when eventC is closed before the Informer has stopped sending events. It adds a mutex to stop the races and checks for the stopC channel to be closed before defaulting to send data on eventC. Tests were not added because testing race conditions buried deep in k8s interfaces are difficult to reproduce.
This also cleaned up a minor linter with a redundant include.
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
make check
make generated
See the contribution guide
for more details.
Release Notes