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

Re: [PATCH 0/1] fsmonitor: fix watchman integration

From
Derrick Stolee <stolee@gmail.com>
Date
Nov 6, 2019, 15:46 UTC
Message-ID
<cca49c40-8abc-96c2-f79c-399f29ceae0d@gmail.com>
In-Reply-To
<BN6PR21MB0786856156CFB55E8812D51E91790@BN6PR21MB0786.namprd21.prod.outlook.com>
On 11/6/2019 10:32 AM, Kevin Willford wrote:
Show 26 quoted lines
>> From: Junio C Hamano <gitster@pobox.com>
>> Sent: Tuesday, November 5, 2019 8:30 PM
>>
>> "Kevin Willford via GitGitGadget" <gitgitgadget@gmail.com> writes:
>>
>>> When running Git commands quickly -- such as in a shell script or the
>>> test suite -- the Git commands frequently complete and start again
>>> during the same second. The example fsmonitor hooks to integrate with
>>> Watchman truncate the nanosecond times to seconds. In principle, this
>>> is fine, as Watchman claims to use inclusive comparisons [1]. The
>>> result should only be an over-representation of the changed paths since
>> the last Git command.
>>> ...
>>
>> So, it doesn't seem to use "inclusive" and we need a workaround?
> 
> That is what is seems like.  I would like to dig into the watchman code
> to understand what is really going on.  They also document that "Using
> a timestamp is prone to race conditions in understanding the complete
> state of the file tree." Which could be the cause since the tests are
> running things in quick succession, i.e. change a file, run a git command.
> 
> Long term we should switch to using watchman's clock id which the
> documentation says does not have the race conditions. But the clock
> id is a string and would take more invasive changes to integrate that
> into the index where we are now simply using a uint64_t.

I should mention that I'm working on a patch series that will allow us to use GIT_TEST_FSMONITOR pointing at Watchman in our CI builds. There are several places where our fsmonitor integration does not work well (such as when we delete submodules), but most of the remaining fixes are small.

This timing issue fixes MOST of the problems we see when running the test suite.

Thanks, -Stolee

Previous: Kevin Willford
Message 6 of 6 in “fsmonitor: fix watchman integration”
  1. 0/1 fsmonitor: fix watchman integrationKevin Willford via GitGitGadget, Nov 4, 2019
  2. 1/1 fsmonitor: fix watchman integrationKevin Willford via GitGitGadget, Nov 4, 2019
  3. SZEDER GáborNov 12, 2019
  4. Junio C HamanoNov 6, 2019
  5. Kevin WillfordNov 6, 2019
  6. Derrick StoleeNov 6, 2019

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.