Watchman hangs for ~2m when passed an inaccessible sockname path
- Dominant language
- C++
- Stars
- 13.7k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
On 4.9.0, running `watchman get-sockname --sockname /some/inaccessible/path` hangs for ~2 minutes.
```
$ time watchman get-sockname --sockname /foo/bar
2017-10-26T21:28:28,701: [cli] unable to talk to your watchman on /foo/bar! (No such file or directory)
real 2m1.620s
user 0m0.001s
sys 0m0.184s
```
I believe this occurs because it attempts to start a new Watchman daemon but that daemon fails because it can't write to the directory. The client gets an `ENOENT` and loops: https://github.com/facebook/watchman/commit/155d656ca218ca8d677638b8cdd3d9196d68a2d2.
One fix would be replacing `should_start(errno)` with `errno == ECONNREFUSED` but I'm not sure if there are other implications of that change.
Contributor guide
Assessment
This issue has not been assessed yet.