-
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/cache: (re-)ensure clean shutdown
CL 549415 (rightly) changed the logic for View shutdown to not await all work on the Snapshot, as this leads to potential deadlocks: we should never await work while holding a mutex. However, we still need to await all work when shutting down the Session, otherwise we end up with failures like golang/go#64971 ("directory not empty"). Therefore, we need a new synchronization mechanism. Introduce a sync.WaitGroup on the Session to allow awaiting the destruction of all Snapshots created on behalf of the Session. In order to support this, View invalidation becomes a method on the Session, rather than the View, and requires the Session.viewMu. Also make a few unrelated cosmetic improvements. Fixes golang/go#64971 Change-Id: I43fc0b5ff8a7762887fbfd64df7596e524383279 Reviewed-on: https://go-review.googlesource.com/c/tools/+/554996 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Alan Donovan <[email protected]>
- Loading branch information
Showing
4 changed files
with
58 additions
and
40 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