facebook / facebook/watchman

Watchman hangs for ~2m when passed an inaccessible sockname path

Open
#543 2 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.