commit | 5061c412c34515188603c0e5d37172f158048682 | [log] [tgz] |
---|---|---|
author | Rob Findley <rfindley@google.com> | Tue Jul 13 09:12:51 2021 -0400 |
committer | Robert Findley <rfindley@google.com> | Tue Jul 13 20:49:08 2021 +0000 |
tree | 8dc5c601f075f352dd9c5478de635ca56ce06e3c | |
parent | ef97713d99aa4e69742aa68fd45a63247b5d3ea0 [diff] |
internal/lsp: signal diagnostic completion if modification failed If didModifyFiles fails we were never closing the diagnoseDone channel. This was potentially leaking goroutines in the regtests. Noticed in https://storage.googleapis.com/go-build-log/ab4085ce/freebsd-amd64-12_2_149b05c3.log Change-Id: I906b643d415c915d7be1951e5d8d21bf9016acee Reviewed-on: https://go-review.googlesource.com/c/tools/+/334250 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> gopls-CI: kokoro <noreply+kokoro@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Rebecca Stambler <rstambler@golang.org>
diff --git a/internal/lsp/text_synchronization.go b/internal/lsp/text_synchronization.go index f54ca37..d9a6961 100644 --- a/internal/lsp/text_synchronization.go +++ b/internal/lsp/text_synchronization.go
@@ -282,6 +282,7 @@ // produce a better error message. The actual race to the cache should be // guarded by Session.viewMu. s.stateMu.Unlock() + close(diagnoseDone) return errors.New("server is shut down") } s.stateMu.Unlock() @@ -291,6 +292,7 @@ snapshots, releases, err := s.session.DidModifyFiles(ctx, modifications) if err != nil { + close(diagnoseDone) return err }