-
Notifications
You must be signed in to change notification settings - Fork 995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Watchman sometimes hangs indefinitely on OS X #96
Comments
Is it hanging or spinning?
or by changing the default in the source if that is easier to deploy:
Also, facepalm moment, I recommend that you upgrade your OS X build to at least 81507da |
I haven't done a full check, but some people claim it is using 100% CPU (the rest did not mention high CPU). So I guess that's spinning. |
We might be hitting this too, causing sporadic failures of our react-native tests - see the error near the end of the output here: https://travis-ci.org/facebook/react-native/jobs/59927075 |
I just put https://reviews.facebook.net/D37683 up for review to tackle this issue. @sahrens The age-out code only triggers once watchman has been running with an active watch that has had files deleted 1 day prior. I'm doubtful that this is impacting your Travis setup. I'll post some suggestions on facebook/react-native#239. |
Summary: looking at #96 (comment) we see a trace like: ``` thread #3: tid = 0x16a58c, 0x000000010438cdc0 watchman`w_ht_del frame #0: 0x000000010438cdc0 watchman`w_ht_del frame #1: 0x000000010439aa40 watchman`age_out_dir + 144 frame #2: 0x000000010439aa28 watchman`age_out_dir + 120 frame #3: 0x0000000104398738 watchman`age_out_file + 248 frame #4: 0x000000010439a9ee watchman`age_out_dir + 62 frame #5: 0x0000000104398738 watchman`age_out_file + 248 frame #6: 0x000000010439a9ee watchman`age_out_dir + 62 frame #7: 0x0000000104398738 watchman`age_out_file + 248 frame #8: 0x000000010439a9ee watchman`age_out_dir + 62 frame #9: 0x0000000104398738 watchman`age_out_file + 248 frame #10: 0x000000010439a9ee watchman`age_out_dir + 62 frame #11: 0x0000000104398738 watchman`age_out_file + 248 frame #12: 0x000000010439a9ee watchman`age_out_dir + 62 frame #13: 0x0000000104398738 watchman`age_out_file + 248 frame #14: 0x000000010439a9ee watchman`age_out_dir + 62 frame #15: 0x0000000104398738 watchman`age_out_file + 248 frame #16: 0x000000010439a9ee watchman`age_out_dir + 62 frame #17: 0x0000000104398738 watchman`age_out_file + 248 ``` In cases where we have a large number of files that are eligible to age out across a reasonable number of dirs, we can walk the same portions of the tree we maintain in memory multiple times. This diff records the names of the dir nodes for which we would previously recursively call age_out_dir(); we use a hash to unique the names. After we have walked all eligible file nodes we then iterate the list of saved dirs and delete them. This reduces the complexity of age out processing to a single scan of the file node list followed by a single scan of the list of dirs that we accumulated in the file node scan. Test Plan: `arc unit tests/integration/age.php` exercises this specifically. also: `make integration` a more rigorous test on our www repo: ``` hg up -C master~40000 ; sleep 10 ; hg up -C master ; sleep 10 ; time watchman debug-ageout . 1 hg up -C master~40000 ; sleep 10 ; hg up -C master ; sleep 10 ; time watchman debug-ageout . 1 ``` (it's important to run it twice in succession because we had a long standing bug that we hadn't noticed until now!) The time portion of this outputs: ``` watchman debug-ageout . 1 0.00s user 0.00s system 2% cpu 0.157 total ``` which is a good bit better than 20+ minutes. Refs: #96 Reviewers: sid0 Reviewed By: sid0 Differential Revision: https://reviews.facebook.net/D37683
Summary: didn't catch this last night because I was focused mostly on Linux. On case insensitive filesystems we also need to clean up the lc_files linkage to avoid a crash during age out. The multiple attempts I added to the integration test trigger this issue: `arc unit tests/integration/age.php` Refs: #96
Fixed a while back; please re-open if this comes back! |
This happened to me just yesterday (6/16) on OS X 10.10.3 while trying to run an ember app with ember-cli. I had to kill the watchman process. Ref: ember-cli/ember-cli#4273 (comment) |
Same with @jtsom, but after upgrading to El Capitan. It worked after reinstalling Watchman. |
Please don't pile on an old closed watchman issue. Open a new one with information that can help diagnose and debug it, thanks! |
We are using ed148a4.
When this happens, we kill it after a few minutes.
Here are some thread traces:
From another user
I have also seen hangs on Linux, but I know that I am using a kernel with unpatched inotify bugs that I know affect watchman (3.13), so I have not bothered to investigate further.
The text was updated successfully, but these errors were encountered: