Commit c0d5e89
committed
internal/lsp/fake: hold the mutex for all of SaveBufferWithoutActions
This addresses the race seen in
https://storage.googleapis.com/go-build-log/5ba1c3f2/windows-386-2008_2bf3acc7.log.
Paraphrased from Rob in chat:
The race is triggered because of the additional asynchronous handling of
file changes added to sync non-dirty files on disk changes. The buffer
is marked as non-dirty, THEN the on-disk change is processed, sending a
didChange, THEN the didSave is sent (https://golang.org/cl/267577).
Also, don't send didChange for formatting if nothing has changed.
Change-Id: Ibc6a55d35dee99c04dadf5470c2d68ca937f849b
Reviewed-on: https://go-review.googlesource.com/c/tools/+/271578
Trust: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>1 parent be796f8 commit c0d5e89
1 file changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
397 | 397 | | |
398 | 398 | | |
399 | 399 | | |
| 400 | + | |
400 | 401 | | |
401 | 402 | | |
402 | | - | |
403 | 403 | | |
404 | 404 | | |
405 | 405 | | |
| |||
408 | 408 | | |
409 | 409 | | |
410 | 410 | | |
411 | | - | |
412 | 411 | | |
413 | 412 | | |
414 | 413 | | |
| |||
423 | 422 | | |
424 | 423 | | |
425 | 424 | | |
426 | | - | |
427 | 425 | | |
428 | 426 | | |
429 | | - | |
430 | 427 | | |
431 | 428 | | |
432 | 429 | | |
| |||
812 | 809 | | |
813 | 810 | | |
814 | 811 | | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
815 | 815 | | |
816 | 816 | | |
817 | 817 | | |
| |||
0 commit comments