1
0
mirror of https://github.com/golang/go synced 2024-11-18 12:14:42 -07:00
go/internal/jsonrpc2
Rob Findley 479cc23432 internal/jsonrpc2: fix goroutine leak when listener is closed
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>
2020-04-27 12:55:06 +00:00
..
servertest internal/jsonrpc2: add concrete types for Call, Notify and Response 2020-04-20 21:05:32 +00:00
handler.go internal/event: renaming the main event API functions 2020-04-23 17:21:36 +00:00
jsonrpc2_test.go internal/telemetry: renaming to internal/event 2020-04-23 17:20:48 +00:00
jsonrpc2.go internal/event: move event/core.Tag to event/label.Label 2020-04-23 18:13:33 +00:00
messages.go internal/jsonrpc2: add concrete types for Call, Notify and Response 2020-04-20 21:05:32 +00:00
serve_test.go internal/lsp: improve ID formatting 2020-04-10 13:25:36 +00:00
serve.go internal/jsonrpc2: fix goroutine leak when listener is closed 2020-04-27 12:55:06 +00:00
stream.go internal/jsonrpc2: rewrite streams in terms of messages 2020-04-21 13:42:58 +00:00
wire_test.go internal/lsp: fix broken lsp logs 2020-04-21 17:00:05 +00:00
wire.go internal/lsp: fix broken lsp logs 2020-04-21 17:00:05 +00:00