You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gopls/internal/filewatcher: synthesize events after watching a dir
Previously, file or subdirectory creations could be missed if they
occurred after a directory was created but before the file watcher was
registered for it. This resulted in missed events for all subsequent
operations within that subdirectory.
This change addresses this gap by performing a breadth-first scan of a
new directory immediately after the watch is established. The scan
iterates over the directory's entries, synthesizes `Create` events for
each one.
The BFS(pre-order) make sure the synthesized events follow logical
order: the parent dir creation events always preceds those of their
children.
The root dir creation event and all synthesized `Create` are added to
the out atomically to make sure the out slice is always holding a
logically correct file events and ready to flush anytime.
Note: file/dir creation events maybe duplicated, one captured by the
scan, one captured by fsnotify but it is promised there is no miss.
For golang/go#74292
Change-Id: Id9b63887d9a7fc83e608bf8390b2f7c198cfc160
Reviewed-on: https://go-review.googlesource.com/c/tools/+/716260
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Hongxiang Jiang <hxjiang@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
0 commit comments