net/rpc: Client.Go allocates a buffered channel with large capacity (10) instead of small (1) when done is nil #41901
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes (go1.15)
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
In the function
func (client *Client) Go(serviceMethod string, args interface{}, reply interface{}, done chan *Call) *Call
, when caller passesdone == nil
, Go will allocate a new channel with buffer 10, which used to notify current Call is finished.What did you expect to see?
It's enough to create a channel with capacity 1
What did you see instead?
The text was updated successfully, but these errors were encountered: