Skip to content

Make watcher symlink-aware (currently follows symlinks) #23418

Closed
@Swatinem

Description

@Swatinem

TypeScript Version: 2.8.1

Search Terms:

  • watch
  • symlink

AFAICS there is actually a lot of issues related to this.

Code

There is not really any code to show.
We do have a mono-repo, that for some issues with one of our dependencies creates manual symlinks between out packages.

Expected behavior:

Things should work

Actual behavior:

When I do a tsc --watch, it takes roughly ~30s to watch all the files, because it actually follows the symlinks.
When running tsserver, either via code or typescript-language-server, the process hangs for >60s with 100% cpu usage. I have attached a debugger and found out that all the time is spent following symlinks and watching those files.
Here is a screenshot of a short profile I have done:

bildschirmfoto von 2018-04-15 17-19-01
(The profile only shows ~18s worth of directory walking, but in reality its way more.

Also, the tsserver process uses in excess of ~1400M of RAM, so it may also explain some of the OOM bugs that I have found with the search.

Playground Link:

Related Issues:

I think #10873 would be an extreme example of this
Otherwise there is a lot of issues mentioning watch mode and extremely slow performance, some of those mention mono-repos, so I guess a lot of this is related.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions