git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 0/4] fsmonitor: start using an opaque token for last update

From
KGKevin Willford via GitGitGadget <gitgitgadget@gmail.com>
Date
Jan 7, 2020, 19:04 UTC
Message-ID
<pull.510.git.1578423871.gitgitgadget@gmail.com>

When using watchman for the fsmonitor there are race conditions when using a timestamp for the last update as noted in the watchman documentation "Using a timestamp is prone to race conditions in understanding the complete state of the file tree." https://facebook.github.io/watchman/docs/clockspec.html

Watchman uses something referred to as a clock id to remove these race conditions. In order to use a clock id for the last update, an opaque value needs to be returned by the fsmonitor hook and saved so that it can be passed back to the fsmonitor hook for the next query. This requires a new version for the fsmonitor index extension and new versions for the fsmonitor watchman hooks. We also need to make sure version 1 of the hook continues to work because users may not update their hook when they update git and we want things to continue to work on repos still using a version 1 hook.

Kevin Willford (4):
  fsmonitor: change last update timestamp on the index_state to opaque
    token
  fsmonitor: handle version 2 of the hooks that will use opaque token
  fsmonitor: add fsmonitor hook scripts for version 2
  fsmonitor: update documentation for hook version and watchman hooks
 Documentation/config/core.txt              |  11 ++
 Documentation/githooks.txt                 |  13 +-
 cache.h                                    |   2 +-
 fsmonitor.c                                | 120 ++++++++++----
 t/helper/test-dump-fsmonitor.c             |   2 +-
 t/t7519-status-fsmonitor.sh                |   7 +-
 t/t7519/fsmonitor-all                      |   1 -
 t/t7519/fsmonitor-all-v2                   |  21 +++
 t/t7519/fsmonitor-watchman                 |   3 +-
 t/t7519/fsmonitor-watchman-v2              | 173 +++++++++++++++++++++
 templates/hooks--fsmonitor-watchman.sample | 138 ++++++++++------
 11 files changed, 405 insertions(+), 86 deletions(-)
 create mode 100755 t/t7519/fsmonitor-all-v2
 create mode 100755 t/t7519/fsmonitor-watchman-v2
base-commit: 0a76bd7381ec0dbb7c43776eb6d1ac906bca29e6
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-510%2Fkewillford%2Ffsmonitor_opaque_token-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-510/kewillford/fsmonitor_opaque_token-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/510
-- 
gitgitgadget
Next: Kevin Willford via GitGitGadget
Message 1 of 13 in “fsmonitor: start using an opaque token for last update”
  1. 0/4 fsmonitor: start using an opaque token for last updateKevin Willford via GitGitGadget, Jan 7, 2020
  2. 1/4 fsmonitor: change last update timestamp on the index_state to opaque tokenKevin Willford via GitGitGadget, Jan 7, 2020
  3. 2/4 fsmonitor: handle version 2 of the hooks that will use opaque tokenKevin Willford via GitGitGadget, Jan 7, 2020
  4. 3/4 fsmonitor: add fsmonitor hook scripts for version 2Kevin Willford via GitGitGadget, Jan 7, 2020
  5. 4/4 fsmonitor: update documentation for hook version and watchman hooksKevin Willford via GitGitGadget, Jan 7, 2020
  6. 0/4 fsmonitor: start using an opaque token for last updateKevin Willford via GitGitGadget, Jan 23, 2020
  7. 2/4 fsmonitor: handle version 2 of the hooks that will use opaque tokenKevin Willford via GitGitGadget, Jan 23, 2020
  8. Johannes SchindelinFeb 5, 2020
  9. 1/4 fsmonitor: change last update timestamp on the index_state to opaque tokenKevin Willford via GitGitGadget, Jan 23, 2020
  10. Johannes SchindelinFeb 5, 2020
  11. 4/4 fsmonitor: update documentation for hook version and watchman hooksKevin Willford via GitGitGadget, Jan 23, 2020
  12. 3/4 fsmonitor: add fsmonitor hook scripts for version 2Kevin Willford via GitGitGadget, Jan 23, 2020
  13. Johannes SchindelinFeb 5, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.