-
Notifications
You must be signed in to change notification settings - Fork 545
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 Panic in PackageManifest Server #590
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: If they are not already assigned, you can assign the PR to them by writing 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 |
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.
looks good but the tests aren't passing
a33648c
to
c358d98
Compare
83189c2
to
73b6b9a
Compare
|
||
go func() { | ||
<-stopCh | ||
m.mu.Lock() | ||
defer m.mu.Unlock() | ||
for _, add := range m.add { | ||
m.add = append(m.add[:addIndex], m.add[:addIndex+1]...) |
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.
This was the actual bug, we weren't removing channels from the slice correctly.
m.modify = append(m.modify, modifyEvent) | ||
m.delete = append(m.delete, deleteEvent) | ||
|
||
removeChan := func(target chan packagev1alpha1.PackageManifest, all []eventChan) []eventChan { |
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.
Nice! Couldn't this be defined as an unexported function since you don't need to close over the lexical scope here?
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.
Meh, not used anywhere else. Prefer to keep things in the tightest scope possible (makes it nice to collapse in my editor).
/approve |
@alecmerdler: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
Fix Panic in PackageManifest Server
Description
Seems to have been caused by variable shadowing.
Fixes https://jira.coreos.com/browse/ALM-823