-
Notifications
You must be signed in to change notification settings - Fork 70
Clean up todos in codegen dir #422
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
Conversation
| s.RUnlock() | ||
| return fmt.Errorf("handler for '%s' is already registered", e.Method) | ||
| } | ||
| s.RUnlock() |
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 we defer s.RUnlock? probably always need to unlock
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's another w-lock 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.
As @cl1337 pointed out, deferring the rlock with cause the wlock to never succeed.
cl1337
left a comment
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.
pending comments
|
|
||
| // Register registers the given TChannelEndpoint. | ||
| func (s *TChannelRouter) Register(e *TChannelEndpoint) { | ||
| func (s *TChannelRouter) Register(e *TChannelEndpoint) error { |
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.
mm ... are we calling this multi-threading? thought Register is sequential in main
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.
Yes, Register is done in one goroutine, the locks in tchannel register is over kill for our use case, but since it's initialization only, so not a big deal.
This PR cleans up the todos in codegen dir except those related to type convertor and middlewares. Relates to #411.