-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gopls/internal/lsp: finish debouncing on context cancellation
While investigating golang/go#59475, I noticed that the gopls command-line is slowed down by the longer diagnostic delay, because shutdown awaits the diagnostics pass, which is not properly cancelled. Fix this by (1) cancelling the snapshot on shutdown, and (2) honoring context cancellation in debounce. This improvement revealed an underlying bug in the diagnose debouncing logic that made the rare flake from golang/go#57710 much more likely: we were using the view name and seqence ID as the debounce key, rather than a unique identifier for the view and/or a globally monotonic ID. Since this test changes and then reverts workspace folders, it was possible for the debouncer to skip the later diagnostics pass, thinking that it had already processed the same key with a higher sequence ID. Fix this redundantly by both using a unique ID for the view, and a globally monotonic sequence ID for the snapshot. Fixes golang/go#57710 Change-Id: I03ea550e561e6fdf6852dce9d844dbe69140cb8c Reviewed-on: https://go-review.googlesource.com/c/tools/+/486115 Run-TryBot: Robert Findley <[email protected]> Reviewed-by: Alan Donovan <[email protected]> TryBot-Result: Gopher Robot <[email protected]> gopls-CI: kokoro <[email protected]>
- Loading branch information
Showing
6 changed files
with
32 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters