-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Always recreate the file watcher when rename event occurs #48997
Conversation
…n that tests presence before creating fs watch
@typescript-bot pack this |
Heya @sheetalkamat, I've started to run the tarball bundle task on this PR at 5dfdbdb. You can monitor the build here. |
@MarcCelani-at Can you try the result of build from #48997 (comment) Its modified version of #47482 |
Hey @sheetalkamat, I've packed this into an installable tgz. You can install it for testing by referencing it in your
and then running There is also a playground for this build and an npm module you can use via |
…sappearance or appearance
@typescript-bot pack this |
Heya @sheetalkamat, I've started to run the tarball bundle task on this PR at bb32906. You can monitor the build here. |
Hey @sheetalkamat, I've packed this into an installable tgz. You can install it for testing by referencing it in your
and then running There is also a playground for this build and an npm module you can use via |
I can't verify this change in our mono repo because we use yarn3, which patches typescript at fixed versions. But I will test this on a small project on mac. |
I'm working on trying to repro this. There's a lot changing in our environment lately (just upgraded from node 12 to node 16) so its taking longer than it should, I think. |
FWIW you can definitely use the above package with yarn 3; it'll cook up a new patched version for whichever version of TS you install, even if it's not one of the stable release versions. |
To install PRs, we ask the bot to "pack this", which gives you something you can put into your
See above: #48997 (comment) |
Sorry, this is taking awhile. We are still on 4.5.4 so I first had to get 4.6.4 working. It turns out this is really difficult in our monorepo environment because of a change that broke tsserver-bridge, details in microsoft/vscode#151245. I'm going to try to get this working without using tsserver-bridge in our monorepo. |
Okay, I have managed to repro the underlying issue on 4.6.4 in our monorepo without crashing the process from memory usage. Then, I upgraded to
|
ah it appears I need to test |
Ok, tried it again on |
@MarcCelani-at did you see lines like: ``sysLog:: ${fileOrDirectory}:: Changing watcher to ...` what did they say.. Can you paste logs from that line by cleaning out private file paths to some random file paths |
This reverts commit dd2164a.
@typescript-bot pack this |
Heya @sheetalkamat, I've started to run the tarball bundle task on this PR at e1ba8a8. You can monitor the build here. |
Hey @sheetalkamat, I've packed this into an installable tgz. You can install it for testing by referencing it in your
and then running There is also a playground for this build and an npm module you can use via |
This reverts commit e1ba8a8.
@amcasey @andrewbranch @jakebailey this is ready for review as @MarcCelani-at confirmed offline that this is working |
As in, there's no event for |
when event occurs on fileNameWithExtension the relative file name in the event is
We received the reports but never concrete repro to see this. Eg on linux vm the tilda thing never came up as part of events and it was working even before that extra commit. In practice we use |
I see; I was just trying to think of an edge case where this method wouldn't be good, but I suppose at worst, it means we look at the non-
Just so I understand, do you mean that |
Okay, I had a change to review all of the commits individually; the first ones all are cleanups and move to baselines that look good to me. The "actual fix" stuff at the end also looks reasonable, so I'm okay with this change (if everyone else is confident), pending my small questions above. I don't really know if I should be trying to reproduce the core issue or not here to really verify, or if we can just wait for feedback if this breaks people on nightly. |
When i reproed the scenario - vim edit and save on ubuntu vm, i didnt get the I think its reasonable to try it out and seek feedback, Our default is to watch files using polling and not using file system events.. So when we added |
Sometimes file appears before the callback is processed and that results in watching wrong inode.
So on every rename event we are recreating the file watcher (which was intention of the existing code by checking fileExists but now the presence check merely determines which kind of watcher is created)
Actual change is in 5dfdbdb and bb32906
Apart from this it is also noticed that when files are edited with vim, the rename event occurs for
fileNameWithExtension~
so that is handled as if the event has occured forfileNameWithExtension
. Fixed in 8e036e5884678e converts all watch related tests to baselines so its easier to reason about
03fa5b3 adds inode watching test by refactoring how sys does fsWatch so that we can test that functionality
c7bbb97 allows to take map of files instead of array when creating test host for watch
189bbc2 test that shows the rename issue
5dfdbdb bb32906 8e036e5 Actual fix
Fixes #47466 (Repro per #47466 (comment))