Skip to content
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

File Watcher glob exclude patterns still don't work #173621

Closed
tcitta opened this issue Feb 6, 2023 · 8 comments
Closed

File Watcher glob exclude patterns still don't work #173621

tcitta opened this issue Feb 6, 2023 · 8 comments
Assignees
Labels
confirmation-pending file-watcher File watcher help wanted Issues identified as good community contribution opportunities info-needed Issue requires more information from poster remote Remote system operations issues

Comments

@tcitta
Copy link

tcitta commented Feb 6, 2023

Type: Bug

Glob patterns for file watcher excludes are still not working for me with the latest VSCode released last week.

Local OS: Windows 11
Remote SSH host OS: centOS 7.5

I'm using a multi-root workspace through the Remote SSH extension. My multi-root workspace contains:

  • firstDir
  • secondDir
  • thirdDir

Where the file tree on disk is:

  • /home/scratch.tim/repo/rel/firmware/firstDir
  • /home/scratch.tim/repo/secondDir
  • /home/scratch.tim/repo/resource/thirdDir

This is a client view into a large perforce depot, so opening .../repo as a workspace is not an option as I am not allowed to store a .vscode directory at the upper levels of the depot.

I cannot exclude secondDir using any documented glob pattern. I must specify the absolute path to the directory, else I receive the unable to watch for file changes in this large workspace popup.

I have tried all of the following files.watcherExclude patterns in my .code-workspace file with no success:

secondDir
**/secondDir
**/secondDir/*
**/secondDir/**
**/secondDir/*/**
${workspaceFolder:secondDir}
${workspaceFolder:secondDir}/**
${workspaceFolder:secondDir}/*/**

Am I missing something? All the docs and comments on this thread as well as #137872 state that at least one of the above patterns should work.

--

VS Code version: Code 1.75.0 (e2816fe, 2023-02-01T15:23:45.584Z)
OS version: Windows_NT x64 10.0.22621
Modes:
Sandboxed: No
Remote OS version: Linux x64 5.4.152-2.x86_64
Remote OS version: Linux x64 5.4.152-2.x86_64

System Info
Item Value
CPUs Intel(R) Core(TM) i7-10850H CPU @ 2.70GHz (12 x 2712)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) undefined
Memory (System) 15.61GB (2.52GB free)
Process Argv --file-uri vscode-remote://ssh-remote%2Bpdx-mse/home/scratch.tcitta_gpu_1/tcitta_pdx_sw/sw/rel/mse_ucode/.vscode/mse_ucode.code-workspace --crash-reporter-id 367237f0-6edb-4485-8688-a528c30024a3
Screen Reader no
VM 0%
Item Value
Remote SSH: pdx-mse
OS Linux x64 5.4.152-2.x86_64
CPUs AMD EPYC 74F3 24-Core Processor (96 x 3991)
Memory (System) 2003.50GB (1873.33GB free)
VM 0%
Item Value
Remote SSH: pdx-fmodel
OS Linux x64 5.4.152-2.x86_64
CPUs AMD EPYC 74F3 24-Core Processor (96 x 2225)
Memory (System) 2015.37GB (1924.15GB free)
VM 0%
Extensions (27)
Extension Author (truncated) Version
docs-view bie 0.0.11
vscode-drawio hed 1.6.6
better-cpp-syntax jef 1.17.2
better-perl-syntax jef 1.0.14
vscode-icon-theme jtl 1.6.6
remote-containers ms- 0.275.1
remote-ssh ms- 0.96.0
remote-ssh-edit ms- 0.84.0
remote-wsl ms- 0.75.1
vscode-remote-extensionpack ms- 0.23.0
remote-explorer ms- 0.2.0
riscv zhw 0.0.8
linkerscript Zix 1.0.3
shell-syntax bma 1.0.3
perlnavigator bsc 0.5.4
doxdocgen csc 1.4.0
disasexpl dse 0.2.4
favorites kdc 2.4.5
vscode-clangd llv 0.1.23
perforce mjc 4.15.5
cpptools ms- 1.13.9
makefile-tools ms- 0.6.0
vscode-yaml red 1.11.0
config-defaults spa 1.3.0
gnu-mapfiles tro 1.1.0
markdown-all-in-one yzh 3.5.0
uncrustify zac 3.2.0

(1 theme extensions excluded)

@bpasero bpasero added file-watcher File watcher help wanted Issues identified as good community contribution opportunities confirmation-pending remote Remote system operations issues labels Feb 7, 2023
@bpasero
Copy link
Member

bpasero commented Feb 7, 2023

Glob patterns should work in any setup, opening for help wanted if someone wants to see if this reproduces in a similar setup and then whether there are any ideas what could cause this.

When you enable trace logs, you can also see further information on how the file watcher is setup. Look for parcel in the remote logs.

@tcitta
Copy link
Author

tcitta commented Feb 7, 2023

I enabled trace output and reloaded the window with the following exclude patterns:

  • **/nvriscv
  • **/nvriscv/**

The following messages were printed to the Remote Server output:

2023-02-06 22:17:11.272 [trace] [File Watcher (parcel)] Request to start watching: /home/scratch.tcitta_gpu_1/tcitta_pdx_sw/sw/nvriscv (excludes: **/.git/objects/**,**/.git/subtree-cache/**,**/node_modules/*/**,**/.hg/store/**,**/nvriscv,**/nvriscv/**,/home/scratch.tcitta_gpu_1/tcitta_pdx_sw/sw/rel/mse_ucode/**/build,/home/scratch.tcitta_gpu_1/tcitta_pdx_sw/sw/rel/mse_ucode/sdk,/home/tcitta/.vscode-server/extensions/**, includes: <all>),/home/scratch.tcitta_gpu_1/tcitta_pdx_sw/sw/rel/mse_ucode (excludes: **/.git/objects/**,**/.git/subtree-cache/**,**/node_modules/*/**,**/.hg/store/**,**/nvriscv,**/nvriscv/**,/home/scratch.tcitta_gpu_1/tcitta_pdx_sw/sw/rel/mse_ucode/**/build,/home/scratch.tcitta_gpu_1/tcitta_pdx_sw/sw/rel/mse_ucode/sdk,/home/tcitta/.vscode-server/extensions/**, includes: <all>),/home/scratch.tcitta_gpu_1/tcitta_pdx_sw/sw/resman/manuals/blackwell (excludes: **/.git/objects/**,**/.git/subtree-cache/**,**/node_modules/*/**,**/.hg/store/**,**/nvriscv,**/nvriscv/**,/home/scratch.tcitta_gpu_1/tcitta_pdx_sw/sw/rel/mse_ucode/**/build,/home/scratch.tcitta_gpu_1/tcitta_pdx_sw/sw/rel/mse_ucode/sdk,/home/tcitta/.vscode-server/extensions/**, includes: <all>)
2023-02-06 22:18:10.419 [error] [File Watcher (parcel)] Inotify limit reached (ENOSPC) (path: /home/scratch.tcitta_gpu_1/tcitta_pdx_sw/sw/nvriscv)

If I use the absolute path /home/scratch.tcitta_gpu_1/tcitta_pdx_sw/sw/nvriscv as the exclude pattern, I do not receive the Inotify error, nor the unable to watch for file changes in this large workspace popup. In this case, I see the following:

2023-02-06 22:29:41.559 [trace] [File Watcher (parcel)] Request to start watching: /home/scratch.tcitta_gpu_1/tcitta_pdx_sw/sw/nvriscv (excludes: **/.git/objects/**,**/.git/subtree-cache/**,**/node_modules/*/**,**/.hg/store/**,/home/scratch.tcitta_gpu_1/tcitta_pdx_sw/sw/rel/mse_ucode/**/build,/home/scratch.tcitta_gpu_1/tcitta_pdx_sw/sw/rel/mse_ucode/sdk,/home/scratch.tcitta_gpu_1/tcitta_pdx_sw/sw/nvriscv,/home/tcitta/.vscode-server/extensions/**, includes: <all>),/home/scratch.tcitta_gpu_1/tcitta_pdx_sw/sw/rel/mse_ucode (excludes: **/.git/objects/**,**/.git/subtree-cache/**,**/node_modules/*/**,**/.hg/store/**,/home/scratch.tcitta_gpu_1/tcitta_pdx_sw/sw/rel/mse_ucode/**/build,/home/scratch.tcitta_gpu_1/tcitta_pdx_sw/sw/rel/mse_ucode/sdk,/home/scratch.tcitta_gpu_1/tcitta_pdx_sw/sw/nvriscv,/home/tcitta/.vscode-server/extensions/**, includes: <all>),/home/scratch.tcitta_gpu_1/tcitta_pdx_sw/sw/resman/manuals/blackwell (excludes: **/.git/objects/**,**/.git/subtree-cache/**,**/node_modules/*/**,**/.hg/store/**,/home/scratch.tcitta_gpu_1/tcitta_pdx_sw/sw/rel/mse_ucode/**/build,/home/scratch.tcitta_gpu_1/tcitta_pdx_sw/sw/rel/mse_ucode/sdk,/home/scratch.tcitta_gpu_1/tcitta_pdx_sw/sw/nvriscv,/home/tcitta/.vscode-server/extensions/**, includes: <all>)
2023-02-06 22:29:41.559 [trace] [File Watcher (parcel)] Started watching: '/home/scratch.tcitta_gpu_1/tcitta_pdx_sw/sw/nvriscv' with backend 'inotify'

@bpasero
Copy link
Member

bpasero commented Feb 18, 2023

I am not able to reproduce this in a similar setup: Windows connected to WSL Ubuntu. Here you go:

  • configuring fs.inotify.max_user_watches to an artificially low value (1024)
  • running sudo sysctl -p to load it
  • opening 2 check outs of vscode repo in a multi root workspace
  • ℹ️ I see the warning right away
  • configure files.watcherExclude to exclude **/src/**, **/extensions/**, **/build/**
  • reload window
  • ✅ I am not seeing the warning anymore

So I believe this is not actually an issue with VS Code or the file watcher we use but something else.

@bpasero bpasero added the info-needed Issue requires more information from poster label Feb 18, 2023
@tcitta
Copy link
Author

tcitta commented Feb 20, 2023

We use Perforce (unfortunately) on CentOS 7.5. Perforce marks all tracked files and directories as read-only until they are checked out; could file permissions cause an issue with the file watcher?

Also, what further logs could I provide?

@bpasero
Copy link
Member

bpasero commented Feb 21, 2023

Maybe, but we are also just relying on a 3rd party file watcher. If possible, can you try to reproduce this by just using https://github.com/parcel-bundler/watcher directly with the exclude options within the Linux host?

@vscodenpa
Copy link

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@vscodenpa vscodenpa closed this as not planned Won't fix, can't repro, duplicate, stale Feb 28, 2023
@tcitta
Copy link
Author

tcitta commented Feb 28, 2023

Can we reopen this? I was able to get to this today and I believe I have reproduced the issue using https://github.com/parcel-bundler/watcher.

I used the code below to reproduce the issue. None of the glob patterns listed in the ignoreGlob array work. I receive the following error message within a few seconds unless I uncomment the absolute path in the ignoreGlob array:

[Error: inotify_add_watch on '/home/scratch.tcitta_gpu_1/tcitta_pdx_sw/sw/nvriscv/release/nvriscv-sdk-2.2/prebuilt/fw/inc' failed: No space left on device]

Apologies if the code isn't great...I've never used javascript before:

const watcher = require('@parcel/watcher');
const path = require('path');

async function main () {
    const dir = '/home/scratch.tcitta_gpu_1/tcitta_pdx_sw/sw/nvriscv';
    
    function sleep(ms) {
        return new Promise(resolve => setTimeout(resolve, ms));
    }
    
    const ignoreGlob = [
        '**/nvriscv',
        '**/nvriscv/**',
        '**/nvriscv/*/**',

        // the directory is only ignored if this line is uncommented
        //'/home/scratch.tcitta_gpu_1/tcitta_pdx_sw/sw/nvriscv'
    ];
    
    const backend = "inotify";
    
    // Subscribe to events
    let subscription = await watcher.subscribe(
        dir, 
        (err, events) => {
            console.log(events);
        }, 
        { ignore: ignoreGlob, backend: backend }
    );
    
    const minutes = 5;
    sleep(minutes * 60 * 1000);
    
    // later on...
    subscription.unsubscribe();
}
  
main().then(() => process.exit(0), e => { console.error(e); process.exit(1) })

@J-Sorenson
Copy link

Can we reopen this? I was able to get to this today and I believe I have reproduced the issue using https://github.com/parcel-bundler/watcher.

I've rarely ever seen them re-open an issue. It's tossed in the bin. Create a new issue with this new information and reference this closed issue so people can see the history. Let them decide if they want to work from the new issue, or close it and re-open the old issue.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
confirmation-pending file-watcher File watcher help wanted Issues identified as good community contribution opportunities info-needed Issue requires more information from poster remote Remote system operations issues
Projects
None yet
Development

No branches or pull requests

5 participants
@bpasero @J-Sorenson @tcitta @vscodenpa and others