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

I think I find a bug when I read source code of feed.go in package event. #16580

Closed
jameszo opened this issue Apr 27, 2018 · 5 comments
Closed
Assignees

Comments

@jameszo
Copy link

jameszo commented Apr 27, 2018

The line 172 to 174 in feed.go of package event which are codes of method Send(value interface{}):

if index >= 0 && index < len(cases) {
    cases = f.sendCases[:len(cases)-1]
}

I think it`s not right, and should be like this:

index = cases.find(recv.Interface())
cases = cases.delete(index)

So that the cases left are the chans which will be TrySend again.

This a doubt when I read the code. Please tell me why if what I thought is wrong. Thanks!

@holiman
Copy link
Contributor

holiman commented Apr 27, 2018

Code, @fjl PTAL

@ryanschneider
Copy link
Contributor

Possibly related to the promoteTx failures referenced in #16673?

Could this lead to a Send call never getting the <-sendLock at feed.go:133 ? I don't see an obvious way it could lead to that but I admit I haven't fully grokked what the feed code is doing reflection in Send.

@fjl
Copy link
Contributor

fjl commented May 4, 2018

I've tried to make it less confusing in #16680. @jameszo Please look at that PR and see if it makes sense to you. I'm not convinced there is a bug here.

@fjl
Copy link
Contributor

fjl commented May 4, 2018

@ryanschneider I don't think sendLock can be messed up like that because it is independent of the select on the actual subscription channels.

@jameszo
Copy link
Author

jameszo commented May 10, 2018

@fjl Ah,I get it! Thank you so much!

@jameszo jameszo closed this as completed May 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@fjl @ryanschneider @holiman @jameszo and others