Skip to content

A root registered inside the watcher hand-off window can be left with no watcher #122

Open

Description

@davison

Backlog capture from the re-review of PR #121 (task #115, #121 (comment)), to be adopted by a later task with --adopts.

Want

#115 fixed the watcher-setup guard so a folder that takes a freed slug never has the old folder's watcher installed under its name, and added a hand-off so the suppressed registration is watched once the first goroutine's starting entry clears. The hand-off is spawned from one exit branch while the starting[slug] entry is released on every exit, so a registration that lands in the window between the guard's unlock and the deferred delete, or that meets the watch.New failure path, can still leave a registered root with no watcher. Milder than what was fixed: the page shows "live update is not available", never a wrong folder's changes. Found by reading, not reproduced.

Shape

Spawn the hand-off from every exit of the setup goroutine (a deferred check of starting against the registry), or have the events endpoint start a watcher lazily when a registered root has none. A test that registers into the window with an injected slow Dirs and asserts the root ends up watched. Small; a rider on the next internal/server task.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions