-
Notifications
You must be signed in to change notification settings - Fork 250
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 tkn p start --showlog by handling informer ResourceEventHandler #2048
Conversation
9b49b6a
to
754f1be
Compare
pkg/pipelinerun/tracker.go
Outdated
AddFunc: func(obj interface{}) { | ||
mu.Lock() | ||
defer mu.Unlock() | ||
select { | ||
case <-stopC: | ||
return | ||
default: | ||
eventHandler(obj) | ||
} | ||
}, | ||
UpdateFunc: func(_, newObj interface{}) { | ||
mu.Lock() | ||
defer mu.Unlock() | ||
select { | ||
case <-stopC: | ||
return | ||
default: | ||
eventHandler(newObj) | ||
} | ||
}, | ||
DeleteFunc: func(obj interface{}) { |
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.
can you please add comments so that it can be clear to the person who visits this code next time
754f1be
to
73fdf55
Compare
/test pull-tekton-cli-build-tests |
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
@pratap0007 can you update the commit and PR description with the cause and solution for the issue? |
73fdf55
to
8a5a6aa
Compare
tkn p start --showlog command was failing as informer ResourceEventHandler was calling UpdateFunc after closing channel so it was crashing and showing error `sending data on closed channel` so this patch handles informer ResourceEventHandler by synchronization and checks if channel is closed then return and does nothing Signed-off-by: ShiV Verma <[email protected]>
8a5a6aa
to
0652c63
Compare
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: piyush-garg 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 |
Fix tkn p start --showlog by handling informer ResourceEventHandler
tkn p start --showlog command was failing as informer ResourceEventHandler
was calling UpdateFunc after closing channel so it was crashing and showing
error
sending data on closed channel
so this patch handles informer ResourceEventHandler by synchronization and checks
if channel is closed then return and does nothing
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