microsoft / pylance-release

Documentation and issues for Pylance
Creative Commons Attribution 4.0 International
1.7k stars 769 forks source link

Pylance from time to time crash (when ssh to remove repo). #6189

Closed rbli-john closed 2 weeks ago

rbli-john commented 1 month ago

Environment data

Code Snippet

XXX

Repro Steps

  1. XXX

Expected behavior

XXX

Actual behavior

XXX

Logs

2024-07-24 23:26:04.022 [info] (Client) Pylance async client (2024.7.101) started with python extension (2024.10.0) 2024-07-24 23:26:04.533 [info] [Info - 11:26:04 PM] (3999797) Pylance language server 2024.7.101 (pyright version 1.1.372, commit d6372d45) starting 2024-07-24 23:26:04.533 [info] [Info - 11:26:04 PM] (3999797) Server root directory: file:///nfs.auto/home/us000110/.vscode-server/extensions/ms-python.vscode-pylance-2024.7.101/dist 2024-07-24 23:26:04.533 [info] [Info - 11:26:04 PM] (3999797) Starting service instance "aigc_inpaint_controlnet_2" 2024-07-24 23:26:04.534 [info] [Info - 11:26:04 PM] (3999797) Starting service instance "samples_parallel15000_9Unet_depthv4_24_8_iter_all_updated_mask" 2024-07-24 23:26:04.534 [info] [Info - 11:26:04 PM] (3999797) Starting service instance "video_inpaint" 2024-07-24 23:26:04.534 [info] [Info - 11:26:04 PM] (3999797) Starting service instance "samples_parallel40000_13Unet_depthv4_48_interval_2_8_iter_None_all_v3" 2024-07-24 23:26:04.534 [info] [Info - 11:26:04 PM] (3999797) Starting service instance "WebVid_validation" 2024-07-24 23:26:04.594 [info] [Info - 11:26:04 PM] (3999797) Setting pythonPath for service "aigc_inpaint_controlnet_2": "/nfs/flash/VideoAlg/personal/us000110/miniconda3/envs/controlnet2/bin/python" 2024-07-24 23:26:04.595 [info] [Info - 11:26:04 PM] (3999797) Setting environmentName for service "aigc_inpaint_controlnet_2": "3.9.19 (controlnet2 conda)" 2024-07-24 23:26:04.602 [info] [Info - 11:26:04 PM] (3999797) No include entries specified; assuming /nfs.auto/flash_VideoAlg/personal/us000110/codebases/aigc_inpaint_controlnet_2 2024-07-24 23:26:04.602 [info] [Info - 11:26:04 PM] (3999797) Auto-excluding /node_modules 2024-07-24 23:26:04.602 [info] [Info - 11:26:04 PM] (3999797) Auto-excluding /pycache 2024-07-24 23:26:04.602 [info] [Info - 11:26:04 PM] (3999797) Auto-excluding /.* 2024-07-24 23:26:04.775 [info] [Info - 11:26:04 PM] (3999797) Assuming Python version 3.9.19.final.0 2024-07-24 23:26:08.497 [info] [Info - 11:26:08 PM] (3999797) Found 427 source files 2024-07-24 23:26:08.524 [info] [Info - 11:26:08 PM] (3999797) Background analysis(1) root directory: file:///nfs.auto/home/us000110/.vscode-server/extensions/ms-python.vscode-pylance-2024.7.101/dist 2024-07-24 23:26:08.524 [info] [Info - 11:26:08 PM] (3999797) Background analysis(1) started 2024-07-24 23:26:08.525 [info] [Info - 11:26:08 PM] (3999797) Background analysis(2) root directory: file:///nfs.auto/home/us000110/.vscode-server/extensions/ms-python.vscode-pylance-2024.7.101/dist 2024-07-24 23:26:08.525 [info] [Info - 11:26:08 PM] (3999797) Background analysis(2) started 2024-07-24 23:26:08.525 [info] [Info - 11:26:08 PM] (3999797) Background analysis(3) root directory: file:///nfs.auto/home/us000110/.vscode-server/extensions/ms-python.vscode-pylance-2024.7.101/dist 2024-07-24 23:26:08.525 [info] [Info - 11:26:08 PM] (3999797) Background analysis(3) started 2024-07-24 23:26:08.525 [info] [Info - 11:26:08 PM] (3999797) Background analysis(4) root directory: file:///nfs.auto/home/us000110/.vscode-server/extensions/ms-python.vscode-pylance-2024.7.101/dist 2024-07-24 23:26:08.525 [info] [Info - 11:26:08 PM] (3999797) Background analysis(4) started 2024-07-24 23:26:08.526 [info] [Info - 11:26:08 PM] (3999797) Background analysis(5) root directory: file:///nfs.auto/home/us000110/.vscode-server/extensions/ms-python.vscode-pylance-2024.7.101/dist 2024-07-24 23:26:08.526 [info] [Info - 11:26:08 PM] (3999797) Background analysis(5) started 2024-07-24 23:26:08.530 [info] [Info - 11:26:08 PM] (3999797) Setting pythonPath for service "samples_parallel15000_9Unet_depthv4_24_8_iter_all_updated_mask": "/usr/bin/python3" 2024-07-24 23:26:08.530 [info] [Info - 11:26:08 PM] (3999797) Setting environmentName for service "samples_parallel__15000_9Unet_depthv4_24_8_iter_all_updated_mask": "3.8.10 (global)" 2024-07-24 23:26:08.530 [info] [Info - 11:26:08 PM] (3999797) No include entries specified; assuming /nfs.auto/flash_VideoAlg/personal/u0403683/Video_Inpainting/animatediff/outputs/samples_parallel15000_9Unet_depthv4_24_8_iter_all_updated_mask 2024-07-24 23:26:08.531 [info] [Info - 11:26:08 PM] (3999797) Auto-excluding /node_modules 2024-07-24 23:26:08.531 [info] [Info - 11:26:08 PM] (3999797) Auto-excluding /pycache 2024-07-24 23:26:08.531 [info] [Info - 11:26:08 PM] (3999797) Auto-excluding */. 2024-07-24 23:26:08.560 [info] [Info - 11:26:08 PM] (3999797) Assuming Python version 3.8.10.final.0 2024-07-24 23:26:08.728 [info] [Info - 11:26:08 PM] (3999797) No source files found. 2024-07-24 23:26:08.732 [info] [Info - 11:26:08 PM] (3999797) Setting pythonPath for service "video_inpaint": "/usr/bin/python3" 2024-07-24 23:26:08.732 [info] [Info - 11:26:08 PM] (3999797) Setting environmentName for service "video_inpaint": "3.8.10 (global)" 2024-07-24 23:26:08.732 [info] [Info - 11:26:08 PM] (3999797) No include entries specified; assuming /nfs.auto/flash_VideoAlg/personal/us000110/proj_misc/video_inpaint 2024-07-24 23:26:08.732 [info] [Info - 11:26:08 PM] (3999797) Auto-excluding /node_modules 2024-07-24 23:26:08.732 [info] [Info - 11:26:08 PM] (3999797) Auto-excluding /pycache 2024-07-24 23:26:08.732 [info] [Info - 11:26:08 PM] (3999797) Auto-excluding /.* 2024-07-24 23:26:08.766 [info] [Info - 11:26:08 PM] (3999797) Assuming Python version 3.8.10.final.0 2024-07-24 23:26:18.878 [info] [Error - 11:26:18 PM] (3999797) Enumeration of workspace source files is taking longer than 10 seconds. This may be because:

XXX
StellaHuang95 commented 1 month ago
Enumeration of workspace source files is taking longer than 10 seconds. This may be because: 
* You have opened your home directory or entire hard drive as a workspace 
* Your workspace contains a very large number of directories and files 
* Your workspace contains a symlink to a directory with many files 
* Your workspace is remote, and file enumeration is slow 
To reduce this time, open a workspace directory with fewer files or add a pyrightconfig.json configuration file with an "exclude" section to exclude subdirectories from your workspace. For more details, refer to https://github.com/microsoft/pyright/blob/main/docs/configuration.md. 2024-07-24

This messsage in your logs indicates that the enumerations of files in your workspace is taking longer than 10 seconds. Could you please check the root of your workspace to see if it matches any of the scenarios described in the error message?

heejaechang commented 1 month ago

From log, we see No source files found. multiple times, but yet we get these message Enumeration of workspace source files is taking longer than 10 seconds.

I think your repo setup is not a typical set up our heuristic based auto setup can handle. it might be better for you to manually setup your workspace. see this link for detail/help - https://github.com/microsoft/pylance-release/wiki/Opening-Large-Workspaces-in-VS-Code#manually-configure-your-workspace

heejaechang commented 1 month ago

for multi root workspace (*.code-workspace), you can use ${workspaceFolder:name} to specific which root include/exclude applied to. without ${workspaceFolder:name}, include/exclude will be applied to all roots.

ex)

{
  "folders": [
    {
      "path": "package1",
    },
    {
      "path": "package2",
      "name": "partial"
    }
  ],
  "settings": {
    "python.analysis.include": ["${workspaceFolder:package1}/src/**"],
    "python.analysis.exclude": ["external/**", "${workspaceFolder:partial}/**/.*", "${workspaceFolder:partial}/venv/**"]
  }
}
github-actions[bot] commented 2 weeks ago

This issue has been closed automatically because it needs more information and has not had recent activity. If the issue still persists, please reopen with the information requested. Thanks.