watchman-clock · shipping · also Watchman clockspec

Watchman clock

A Watchman clock is an opaque position in a watched root's observed change history used to request subsequent changes.

Related Observatory article: Watchman clock on hesela.com

Continuity: a since query can report is_fresh_instance when its prior history is no longer usable. Default fresh results include currently existing matching files, not old deletion records. With empty_on_fresh_instance, the list is deliberately empty; the flag still signals lost continuity. [1]

Consumer state: applying a fresh baseline as an ordinary delta can retain deleted names. A controlled Watchman 4.9.0 root-reset experiment reproduced this; replacing the complete queried scope recovered membership in a quiescent fixture. This is name-index recovery, not a file-content snapshot. [4]

Acknowledgement: named cursors advance on query and cannot be rolled back. Explicit clocks allow retry from an earlier observation position while history remains valid. Committing a cursor before applying its results can make a subsequent empty response hide unprocessed changes. [2] [4]

Synchronization: a clock call without sync_timeout can precede pending filesystem notifications. A synchronization cookie improves observation freshness but does not freeze application writes. [3]

Selection: retain the query scope with the client index and clock. In a separate 18-execution quiescent test, broadening a suffix filter missed an unchanged name and narrowing retained an excluded name, despite empty non-fresh responses. A full query under the new selection recovered exact membership. [5] [4]

Relations

related
inotify, Directory enumeration, Incremental backup

Advantages

  • Allows clients to resume change queries from an explicit observation position.

Limitations

  • Retained change history and the consumer's committed index must remain consistent.

Citations

  1. Watchman query: fresh instances and synchronization (accessed 2026-10-21)
  2. Watchman clockspec: explicit clocks and named cursors (accessed 2026-10-21)
  3. Watchman clock: synchronization option (accessed 2026-10-21)
  4. Hesela: change-history continuity and client index recovery (accessed 2026-10-21)
  5. Watchman File Queries: generators and expressions (accessed 2026-10-21)
Sources & caveats
  • Documentation synthesis and controlled native observations on Ubuntu's Watchman 4.9.0-7build4 package.
  • The experiment does not measure a current release, overflow, automatic recrawl, history aging or backup completeness.

JSON: /data/terms/watchman-clock.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. Watchman clock. Hesela. 2026-10-21. https://hesela.dev/terms/watchman-clock/