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
{{ message }}
Repository navigation
exclude ignore_vcs dirs from ignore_dirs to avoid breaking cookies #17
The since query is slow? Did you change any files before running the since query, or is it slow as soon as you start it up? What if you query it a few minutes after it started up?
With 56fcdba or later the command is slow every time I run it: as soon as I start up and every subsequent time. I haven't tried other queries as this is the only query I need to run, but watchman -v is fast before and after 56fcdba.
is there anything churning through and changing files in your buck working copy while you're running the since query?
This is what I see with a non-built buck tree:
$ time echo '["query", "/Users/wez/fb/buck", {"since": "n:w00t", "fields":["name","exists","new"]}]' | ~/fb/watchman-pure/watchman --server-encoding=json --no-pretty -j > /dev/null
echo 0.00s user 0.00s system 34% cpu 0.002 total
~/fb/watchman-pure/watchman --server-encoding=json --no-pretty -j > /dev/null 0.00s user 0.00s system 0% cpu 0.656 total
$ time echo '["query", "/Users/wez/fb/buck", {"since": "n:w00t", "fields":["name","exists","new"]}]' | ~/fb/watchman-pure/watchman --server-encoding=json --no-pretty -j > /dev/null
echo 0.00s user 0.00s system 28% cpu 0.002 total
~/fb/watchman-pure/watchman --server-encoding=json --no-pretty -j > /dev/null 0.00s user 0.00s system 28% cpu 0.019 total
The code that changed should only impact how quickly we can translate fsevents items into change nodes.
The only way that I can think of that this might somehow influence the query speed is if there is a continual stream of changes coming in and if there is lock contention here:
ahead of that lock acquisition to avoid locking when we don't need to, but don't know that this will fundamentally change what you're seeing. Also: this wasn't changed in 56fcdba
This is the contents of my .watchmanconfig:
{
"ignore_dirs": [
".git",
".buckd",
"build",
"buck-out",
"src/com/facebook/buck/cli/quickstart",
"test/com/facebook/buck/cli/testdata",
"test/com/facebook/buck/java/testdata",
"test/com/facebook/buck/junit/testdata",
"test/com/facebook/buck/parser/testdata",
"test/com/facebook/buck/shell/testdata",
"third-party/java/dalvik-jelly-bean"
]
}
You shouldn't ignore .git as you can break the cookie detection; maybe that's the root of the problem?
I'll dig into this a bit later, but maybe just removing that one line fixes it for you?
I think the behavior here should be: if a dir is listed in both ignore_vcs and ignore_dirs, ignore_dirs takes precedence and the dir is removed from the effective value of ignore_vcs for the root.
This will allow someone to explicitly ignore a dir and not break the cookie mechanism.
Activity
wez commentedon Dec 20, 2013
The since query is slow? Did you change any files before running the since query, or is it slow as soon as you start it up? What if you query it a few minutes after it started up?
jimpurbrick commentedon Dec 20, 2013
With 56fcdba or later the command is slow every time I run it: as soon as I start up and every subsequent time. I haven't tried other queries as this is the only query I need to run, but watchman -v is fast before and after 56fcdba.
wez commentedon Dec 20, 2013
is there anything churning through and changing files in your buck working copy while you're running the since query?
This is what I see with a non-built buck tree:
The code that changed should only impact how quickly we can translate fsevents items into change nodes.
The only way that I can think of that this might somehow influence the query speed is if there is a continual stream of changes coming in and if there is lock contention here:
https://github.com/facebook/watchman/blob/56fcdbac15bd6cda1790c13aa9b05bf9fa3cd237/root.c#L1821
I'm thinking of putting in:
ahead of that lock acquisition to avoid locking when we don't need to, but don't know that this will fundamentally change what you're seeing. Also: this wasn't changed in 56fcdba
jimpurbrick commentedon Dec 20, 2013
Looks like this does have something to do with .watchmanconfig:
jimp-mbp1:buck jimp$ time echo '["query", "/Users/jimp/devtools/buck", {"since": "n:buckd", "fields":["name","exists","new"]}]' | watchman --server-encoding=json --no-pretty -j > /dev/null
real 0m0.019s
user 0m0.004s
sys 0m0.003s
jimp-mbp1:buck jimp$ mv .watchmanconfig.renamed .watchmanconfig
jimp-mbp1:buck jimp$ watchman shutdown-server
1387569637: tid=2033447296 failed to identify PDU: fill_buffer: No such file or directory
1387569638: tid=2033447296 failed to identify PDU: fill_buffer: Operation timed out
1387569638: tid=2033447296 unable to talk to your watchman!
jimp-mbp1:buck jimp$ time echo '["query", "/Users/jimp/devtools/buck", {"since": "n:buckd", "fields":["name","exists","new"]}]' | watchman --server-encoding=json --no-pretty -j > /dev/null
real 1m1.008s
user 0m0.004s
sys 0m0.003s
(this is with HEAD)
jimpurbrick commentedon Dec 20, 2013
This is the contents of my .watchmanconfig:
{
"ignore_dirs": [
".git",
".buckd",
"build",
"buck-out",
"src/com/facebook/buck/cli/quickstart",
"test/com/facebook/buck/cli/testdata",
"test/com/facebook/buck/java/testdata",
"test/com/facebook/buck/junit/testdata",
"test/com/facebook/buck/parser/testdata",
"test/com/facebook/buck/shell/testdata",
"third-party/java/dalvik-jelly-bean"
]
}
wez commentedon Dec 20, 2013
You shouldn't ignore .git as you can break the cookie detection; maybe that's the root of the problem?
I'll dig into this a bit later, but maybe just removing that one line fixes it for you?
jimpurbrick commentedon Dec 20, 2013
Looks like that was it, thanks!
wez commentedon Dec 21, 2013
Sounds like watchman should sanity check that you're not ignoring vcs dirs, or specifically, that you're not ignoring the selected cookie dir
wez commentedon Aug 7, 2014
I think the behavior here should be: if a dir is listed in both ignore_vcs and ignore_dirs, ignore_dirs takes precedence and the dir is removed from the effective value of ignore_vcs for the root.
This will allow someone to explicitly ignore a dir and not break the cookie mechanism.
more gracefully handle overlapping ignore options
watchman: avoid recursive case during age out
change logging in exit handlers to not avoid locking