-
Notifications
You must be signed in to change notification settings - Fork 186
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
Topic handler bug fixes #225
Conversation
c57bc57
to
96c5d3f
Compare
topic.go
Outdated
if t.closed { | ||
return nil | ||
} | ||
|
||
req := &rmTopicReq{t, make(chan error, 1)} | ||
t.p.rmTopic <- req |
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.
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 true for all previous PubSub functions and the new Topic ones. I've pushed an update, lmk if that's what you had in mind.
Three questions about fixing this:
- Do I want custom
ErrPubSubClosed
messages or is the context error enough (both for the PubSub functions and for the Topic functions)? - Should I set
Topic.closed=true
on any/all of the pubsub context errors? - It seems more reasonable to return an empty array then nil for
GetTopics
andListPeers
right?
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.
@vyzo any thoughts on the first 2 questions here? Would like to get this pushed out ASAP since the Close
bug is particularly bad.
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.
- either works, it's a very small thing.
- probably not, I don't see what we would gain from this.
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 modulo the nit about returning nil
for empty lists.
But that's not normative, feel free to fix or leave it as is.
…een cancelled instead of hanging
Fixes the issues named in #224 namely:
Calling Topic.Close() throws an NRE 😨
Calling Topic.Close() still allows some calls to be utilized (e.g. can still Publish after Close)