mirror of
https://github.com/golang/go
synced 2024-11-18 12:14:42 -07:00
479cc23432
When jsonrpc2.Serve times out or is cancelled, we leak the goroutine that is accepting connections, because it is stuck trying to write its error back to the doneListening channel. Fix this by adding a context cancellation for the serve func, and selecting on this context when writing the error. Change-Id: I3383535f58b44616983816e8b257a975e3c337a7 Reviewed-on: https://go-review.googlesource.com/c/tools/+/229978 Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Cottrell <iancottrell@google.com> |
||
---|---|---|
.. | ||
servertest | ||
handler.go | ||
jsonrpc2_test.go | ||
jsonrpc2.go | ||
messages.go | ||
serve_test.go | ||
serve.go | ||
stream.go | ||
wire_test.go | ||
wire.go |