-
Notifications
You must be signed in to change notification settings - Fork 984
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
Use latest watchman #21546
base: develop
Are you sure you want to change the base?
Use latest watchman #21546
Conversation
@vkjr @smohamedjavid can you test if you still get the watchman bug from #16341 on this branch? |
Jenkins BuildsClick to see older builds (18)
|
Looks good to me, metro didn't crash for me locally. |
component tests do fail though : |
@clauxx : component tests pass for me locally after I revert your changes to |
Can confirm that the bug is NOT present anymore, and file changes (hot reload) work well as expected. Thanks 🙏 |
"ignore_dirs": [ | ||
"android/build", | ||
"target" | ||
"target", | ||
".clj-kondo", | ||
".shadow-cljs" | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while debugging metro, found that watchman is keeping track of these two directories (e.g. .clj-kondo
has ~12000 files usually and .shadow-cljs
~3000). On top of that, working in the editor/IDE causes constant changes to .clj-kondo
's cache, which re-trigger watchman making it do extra work for no reason (and also hogging up my CPU at times).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just upgrade the on in nix/pkgs
?
The latest metro version requires watchman capabilities that are not available in the version we locked, so it was not used. Instead we used the "node watcher", which is slower and buggier (at least for me metro was timing out quite often)
9b4fe71
to
f380670
Compare
@jakubgs do you mean upgrade watchman from the nix/pkgs file? Could do, but I'm not as versed in nix, so it seemed easier & less time consuming to just use the latest version by removing it tbh. On a sidenote, I removed the yarn.lock/podfile changes as it seems like it wasn't necessary for my issue. It seems like the problem with the un-killable node process was the linux kernel, where the node process was stuck in the "uninterruptible sleep" state, so that should explain why SIGKILL didn't do much. Updating the kernel version fixed the issue so far. cc: @siddarthkay |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we used Nix for the package because - as the README states - we simply wanted to downgrade.
What I don't get is why is the fb-watchman
in yarn.lock
even older than the 4.9.0
that we provide via Nix right now?
Lines 6053 to 6058 in ca22b67
fb-watchman@^2.0.0: | |
version "2.0.1" | |
resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.1.tgz#fc84fb39d2709cf3ff6d743706157bb5708a8a85" | |
integrity sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg== | |
dependencies: | |
bser "2.1.1" |
Summary
fixes #21545
Watchman was locked at an older version due to #16341. After the latest upgrade though, metro requires the latest watchman version and falls back to the "node watcher" (slower and buggier). This ends up (for me) with random timeouts when starting metro, since it takes the node watcher quite a bit of time to go through all the files, and we have a lot of them.
Need to make sure the issue from the latest Watchman, which was mentioned above, doesn't appear for anyone.
Also, I started getting a weird issue with metro's node process not dying after getting closed/killed. Sometimes it lost connection to the device and neither CTRL-C nor SIGKILL could get rid of the rogue
node
process. Inspecting the process' strace, I noticed that it tried to access non-existent files/directories insidenode-modules
, right at the moment node became non-responsive. Not sure how that's related to the unkillable process, but re-creating theyarn.lock
seems to have fixed it (for now).The strace:
status: ready