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

bug: fix infinite loop of asyncCallback #230

Merged
merged 2 commits into from
Aug 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/remoting/getty/getty_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (client *GettyRemotingClient) SendSyncRequest(msg interface{}) (interface{}
}

func (g *GettyRemotingClient) asyncCallback(reqMsg message.RpcMessage, respMsg *message.MessageFuture) (interface{}, error) {
go g.asyncCallback(reqMsg, respMsg)
go g.syncCallback(reqMsg, respMsg)
return nil, nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

两个问题:
1 这个函数的返回值没有任何意义,整体有效代码只有一个异步 goroutine;
2 你这个改动就加了个错误处理,怎么就能停止无限循环,没看明白

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

asyncCallback -> syncCallback

}

Expand Down