SanderRonde / phpstan-vscode

PHPStan plugin for VSCode
https://marketplace.visualstudio.com/items?itemName=SanderRonde.phpstan-vscode
MIT License
47 stars 8 forks source link

Multiple PHPStan runs happening in parallel #80

Closed berniedurfee-renaissance closed 2 months ago

berniedurfee-renaissance commented 5 months ago

I have a similar issue to this (https://github.com/swordev/phpstan-vscode/issues/11) when using this plugin.

I see many runs of PHPStan happening at the same time. Not sure if it's the same issue, but I don't see this issue on the command line.

I have max core usage for PHPStan set to 2 in my config:

parallel:
    maximumNumberOfProcesses: 2

Using PHPStan v1.11.1

vendor/bin/phpstan --version
PHPStan - PHP Static Analysis Tool 1.11.1
image
SanderRonde commented 5 months ago

In theory it should kill any running processes whenever a new one is spawned. I think it should be pretty easy to figure out where it goes wrong. If you open up vscode it should do a single check. If at that point you have many running processes then it's an issue with the config not being respected. If not then something might be going wrong with the killing of processes. Can you test that for me?

Something else it could also be: are you sure your config file is being used in the checks? You can verify by checking the logs of the extension in the output panel.

You can also run phpstan with the same command you see there to test out where it's going wrong.

berniedurfee-renaissance commented 5 months ago

If I'm very careful not to save often, the extension behaves fine. It's if I'm working fast, making changes and hitting CMD+S often that the processes start to pile up and it bogs my machine down to a crawl with so many PHPStans running simultaneously.

I think the PHPStan worker processes take some time to die.

I see the 2s wait time for the main process to die, but that might not be enough in some instances.

Maybe keep a loop going to be sure the processes are dead? Also, maybe check the child (worker) processes of the main PHPStan process to be sure they're all dead before proceeding to fire up a new process?

SanderRonde commented 5 months ago

There is indeed a 2 second timer for the process to exit gracefully. But after that a SIGTERM is sent, after which a SIGKILL is sent if it's still not behaving. Only when either the process exits or it takes 10s to exit does the extension move on and spawn a new one. I could consider bumping the 10s, but I'm not too sure if the extension will be able to be of any use if PHPStan resists being killed.

I could maybe look at the children of the main process but implementing a process-tree crawler that works cross-platform is really hard in node. Every platform has different semantics around these things.

A simpler alternative might be to get PHPStan Pro which has a watch mode that's built into the process itself. Meaning it itself watches instead of an external program (my extension in this case) spawning processes and killing them. By doing so you'll also support the creator (not me btw, I don't get anything from this endorsement). This extension integrates with the Pro mode by showing the errors that Pro collects in your editor and by starting/stopping pro mode as you open your project.

Ideally I'd of course want to fix the issue but it seems to be worse on a mac (at least I haven't heard anyone report it on a windows/linux device yet) and I don't own a mac so I can't reproduce it.

quazardous commented 5 months ago

Hi,

I don't know if it's related but sometime phpstan starts piling up project scan.

The bar show "phpstan scanning file 123/1567" (or something like that).

But I do not want phpstan to start project scan (or maybe once at startup). My projects has 1500+ files and my phpstan runs in docker. Just scanning current file is fine but maybe it's a chain effect with the dependencies ?

When it happens vscode just end up crashing on memory usage...

PS: I was not able to make phpstan server work using phpstan@docker. is there some documentation about it ?

EDIT: I'm under fedora 40

SanderRonde commented 5 months ago

That does sound like another issue. It's not so much piling up as it's just a single big scan happening. Sounds like the phpstan.singleFileMode setting is what you're looking for. By default this extension checks the whole project (since that's what the author of PHPStan recommends). But with that mode enabled it'll only perform checks for the current file.

The reason he recommends that is that in the long run, performing single-file checks is much slower. Since it invalidates the cache every time. That means it doesn't scan just the files that changed and its usages, but also needs to scan its dependents. So in the long run single-file-mode costs you more CPU time. If you've completed a succesful checks once, the cache will ensure checks from then on are much less heavy. But I can understand not going for complete checks on a relatively low-power machine.

I haven't used PHPStan inside docker myself so no documentation for it (yet). But you should be able to make it work by using the phpstan.binCommand setting, maybe using the phpstan.paths setting too (explanation here). There are also quite some issues on this repo discussing docker support so you might be able to puzzle it together based on those (such as #1).

wallacio commented 4 months ago

I think that does sound like another issue - albeit one that we're also seeing. Project contains > 2000 files/scripts, which renders VSCode unusable for 10-15 seconds after every save as PHPStan rips through the entire project. On a machine with 10th gen i7 CPU, that does seem abnormally long.

Enabling singleFileMode does improve things marginally but there's still a considerable delay between ctrl+s and being able to navigate method definitions etc by ctrl+click on method names, for example whilst "PHPStan checking..." whirls away in the status bar. I do only see a single php process running, so it's not like it's kicked off multiple processes.

Performance is preventing us from using this on-save so we'd love to find a solution. Any help in diagnosing this, if it's not related to other the other people in this issue's experiences would be appreciated. Fully appreciate it may be nothing to do with this extension, either.

SanderRonde commented 4 months ago

That does indeed sound unrelated to the extension. The performance hit probably comes from running PHPStan itself, which is spawned by the extension but since it's spawned in it shouldn't be hanging up the UI thread. If that's happening it's likely that your computer is just being maxed out. That's not surprising btw, when I run it on my own desktop PC (with a similarly powerful CPU) it also freezes completely. At my job we've got a massive 128-core beast of a dev-server that I can execute PHPStan on. Even on that thing it takes ~20s to check ~2k files and it consumes a large amount of processing power. PHPStan is pretty demanding.

You can test this out by just running PHPStan by itself on the commandline. If it's fast, it's the extension's fault. If it's slow, then it's PHPStan itself being slow :)

martijn-dd commented 4 months ago

I have the same as berniedurfee-renaissance on my Mac. PHP processes piling up.

I checked the extension log files of VS Code. In the PHPStan Client Log I noticed the following (hide the file path with ------) :

[check:23] Check started for file: ------ [check:22] Check completed for file, errors= {"fileSpecificErrors":{},"notFileSpecificErrors":[]} [check:23] Spawning PHPStan with the following configuration: {"binStr":"/opt/homebrew/bin/phpstan","args":["analyse","-c","------/phpstan.neon","--error-format=json","--no-interaction","--memory-limit=1G","--no-progress","------.php"],"tmpDir":"/tmp/phpstan"} [process-spawner] Spawning process 18610 with timeout 900000 [file-watcher] Checking: Document changed

with timeout 900000 => 900 seconds I guess? But in the extension settings the Project timeout is 300000 and the other timeout is 30000.

Maybe that timeout of 15 minutes could cause that it looks like the processes are not stopped/killed but takes longer than expected.

Let me know if I need to provide more details to help you solve the issue.

SanderRonde commented 4 months ago

Correct that's 15 minutes. There's two timeouts:

(I agree that logging-wise this is very unclear, might change that in the future)

Sectimus commented 3 months ago

Just like to add I am also getting the same issue. I too am using docker. Same experience, if I am going at a slow pace everything works nicely, but a quick ctrl+s here, ctrl+z there, another ctrl+s here and bam you have a bunch of php instances eating your laptop alive. Twice now today I have had a hard OOM crash due to this, I really like this extension, once everything works, it works great. But it does make it difficult to continue use... Here is my config for reference:

"phpstan.rootDir": "${workspaceFolder}",
"phpstan.configFile": "build/phpstan/src.1.neon.dist,build/phpstan/src.2.neon.dist,build/phpstan/tests.1.neon.dist,build/phpstan/tests.2.neon.dist,build/phpstan/tests.3.neon.dist",
"phpstan.binPath": "/var/www/REDACTED/vendor/bin/phpstan",
"phpstan.projectTimeout": 9999999,
"phpstan.paths":{
    "${workspaceFolder}": "/var/www/REDACTED",
},
"phpstan.binCommand": ["docker", "exec", "-t", "REDACTED_api_php-1", "php", "/var/www/REDACTED/vendor/bin/phpstan"],
"phpstan.memoryLimit": "4096M",

I have tried the singleFileMode option as well, that does indeed make the general experience much snappier, but the php instances are still not killed, they don't seem to be doing anything else when they get in this "zombie" state, they exist purely to consume human brains resources and nothing more.

Sectimus commented 3 months ago

Perhaps related to this similar issue that moby experienced whilst spawning processes from docker exec: https://github.com/moby/moby/issues/9098

SanderRonde commented 3 months ago

Ah yeah that would actually very much so explain the issue. Thanks for the suggestion! Will try to fix this some time soon but since I'm currently a bit busy it might take a while.

tedg commented 3 months ago

Having this issue without using docker. I'm running VSCode using the remote ssh extension, and I can very easily spawn multiple processes of phpstan via this extension by rapidly saving a file, even with maximumNumberOfProcesses: 1 in my config. I'm running in single file mode.

Adding timestamps to the console logging would also be helpful here to track down there timing issues.

EDIT: Will clarify that it is spawning new worker processes each time I save

SanderRonde commented 3 months ago

@tedg On which platform are you using remote SSH? I've been using remote SSH into linux for quite a while now and haven't really ran into the issue myself so it would be really nice if I could find someone who can replicate the issue in a plain non-docker environment (while I dive into the docker issue on the side). Would you be willing to help me out in debugging by using a debug build that adds some logging around what processes are being killed and which aren't? That would really help a lot in debugging

tedg commented 3 months ago

@tedg On which platform are you using remote SSH? I've been using remote SSH into linux for quite a while now and haven't really ran into the issue myself so it would be really nice if I could find someone who can replicate the issue in a plain non-docker environment (while I dive into the docker issue on the side). Would you be willing to help me out in debugging by using a debug build that adds some logging around what processes are being killed and which aren't? That would really help a lot in debugging

Yup I am using linux in a non-docker env. Let me know how I can help.

Eamead commented 3 months ago

Hello, came to chime in with my own voice. I'm having this issue as well, and unlike some of the other commenters I'm running in a relatively small project (Less than 300 files). I'm seeing this happen on a Windows non-docker environment. I'm also happy to set up a debug environment on my machine to assist.

Edit: As an additional point I wasn't seeing elsewhere, new php cli's aren't only opening on save. They seem to continuously pile up independently. It might be that the cli is actually closing on time but that new ones just keep opening.

SanderRonde commented 3 months ago

I've created a debug build that includes a bunch of logging. Probably the easiest way to view/export this is to open up the devtools in VSCode (Help -> Toggle Developer Tools), go to the console, filter on debug in the top bar and export it by right-clicking the window. To install the below zip (github doesn't allow uploading .vsix files), rename the file to .vsix, go to the extensions tab in your editor, hit the dots on the top-right, then "install from VSIX" and select the file. Thanks a lot!

Edit: As an additional point I wasn't seeing elsewhere, new php cli's aren't only opening on save. They seem to continuously pile up independently. It might be that the cli is actually closing on time but that new ones just keep opening.

Hmm could this be PHPStan spawning new workers as it's going through the files? Not too sure what could be causing that.

phpstan-vscode-3.1.14.zip

Eamead commented 3 months ago

Alright so, a couple of things of note:

  1. Because I wasn't sure what type of information would be in a debug file for this and there is sensitive information in my project, I started trying to follow your instructions by using an old side project (using the same machine as my main project). However, in this demo environment I was unable to replicate the bug.

  2. As soon as I switched back to my main project the bug reappeared. Perhaps this bug is only present in bad configurations?

  3. The debugger is not capturing any information.

  4. I am however seeing the following the the console window (not sure if it's related at all):

log.ts:429 WARN Settings pattern "application.*" doesn't match any settings log.ts:419 INFO Extension host (LocalProcess pid: 10480) is unresponsive. localProcessExtensionHost.ts:275 Extension Host localProcessExtensionHost.ts:276 Debugger attached. log.ts:419 INFO UNRESPONSIVE extension host: starting to profile NOW log.ts:419 INFO Extension host (LocalProcess pid: 10480) is responsive. log.ts:419 INFO UNRESPONSIVE extension host: received responsive event and cancelling profiling session log.ts:429 WARN UNRESPONSIVE extension host: 'sanderronde.phpstan-vscode' took 98.18580978301088% of 597.063ms, saved PROFILE here: 'file:///c%3A/Users/ADM~1.SCC/AppData/Local/Temp/exthost-d651ca.cpuprofile' index.js:40

In case it's relevant, I've attached the noted file: exthost-d651ca.cpuprofile

SanderRonde commented 3 months ago
  1. Just to give you some more info, all this build does is log stuff to the developer tools' console. You can then copy the text in there (and strip anything sensitive). There shouldn't be anything sensitive in there though, only "launched with configuration X" "process ID Y killed" etc.
  2. That's interesting. Is there any difference in your configuration of the extension, or any difference in the configuration of PHPStan itself?
  3. Just checking, do you mean the devtools? It should at the very least be dumping out some PHPStan logs, even if you don't filter on debug at the top.
  4. Well that sounds pretty related, looks like the extension is crashing or something. Do you get this every time, do you get this only when using this version of the extension or also for the version in the store?

I could screencapture the steps to clarify things if that would help btw

Eamead commented 3 months ago
  1. Noted.
  2. Folder structure is slightly different in the demo project. Otherwise no. I'm actually no longer even sure i am seeing the bug. I had about 15 instances of the php cli at one point but haven't seen it go into the hundreds like it had been. Debug build is working?
  3. Oh, it shows other things, just not when filtering by debug (aside from telling me that the debugger is loaded and that xDebug isn't).
  4. I don't get this every time. But it does happen sometimes for sure. Both with this version and store version.

I think i understood your instructions fairly well.. but if you would like to send me screencaptures to be sure you can.

SanderRonde commented 3 months ago
  1. Well that's interesting. Could it maybe be related to the size of the project? The bigger project has more files so it's more likely to still be running while another instance spins up? The debug build shouldn't change any functionality in theory. It only adds some logs so that it would be surprising if it somehow fixed it.
  2. That might mean that you didn't install the provided .vsix file correctly and are just using the store version. Could that be the case? Do you see any debug-related statements in the output panel (I show it in the video).
  3. Not too sure what this is, maybe it's not necessarily related but just VSCode complaining that the PHPStan run is taking up a lot of CPU.

An additional question, do you have the phpstan.enableLanguageServer setting enabled? That does occasionally cause some cache invalidation issues so you might want to try turning that off.

I've recorded a video to be sure everything is going right (and for you to see what it's supposed to look like when it works).

https://github.com/user-attachments/assets/fca63f50-e88c-4115-abf2-b4adfe3937be

SanderRonde commented 2 months ago

I've done some work on the Docker issues and have made some changes:

I've attached a build containing these changes. (again the same goes, .zip file, rename to .vsix, drag into the extensions panel). @Sectimus can you give this build a try and see if it improves anything. Be sure to use the new setup feature so that the container name is saved in settings or it won't work.

phpstan-vscode-3.1.14.zip

momala454 commented 2 months ago

personnaly i have the problem, and enableLanguageServer is enabled, it spawn 10s of process at the same time and make wsl/vscode unresponsive, with a load average on wsl of like 70

ps aux | grep -c sanderronde
156

and when it finally start responding again, I restart vscode, load average is normal again, but there are still 90 "sanderronde" process running, i need to manually kill them

edit: here is an example of the output when i modify 3 times a line without waiting for the previous phpstan process to finish

[8/20/2024, 4:03:31 PM] [client] Starting extension with configuration: {
    "binPath": "vendor/bin/phpstan",
    "binCommand": [],
    "configFile": "phpstan.neon,phpstan.neon.dist,phpstan.dist.neon",
    "rootDir": "",
    "options": [],
    "enableStatusBar": true,
    "memoryLimit": "1G",
    "enabled": true,
    "projectTimeout": 300000,
    "suppressTimeoutMessage": false,
    "paths": {},
    "showProgress": false,
    "enableLanguageServer": true,
    "ignoreErrors": [],
    "suppressWorkspaceMessage": false,
    "pro": false,
    "tmpDir": "",
    "checkValidity": false
}
[8/20/2024, 4:03:31 PM] [client] Initializing done
[8/20/2024, 4:03:31 PM] [client] Showing one-time messages (if needed)
[8/20/2024, 4:03:31 PM] [server] Language server ready
[8/20/2024, 4:03:31 PM] [server] Language server started
[8/20/2024, 4:03:32 PM] [file-watcher] Checking: New document active active
[8/20/2024, 4:03:32 PM] [check:1] Check started for project
[8/20/2024, 4:03:32 PM] [status-bar] Showing status bar
[8/20/2024, 4:03:32 PM] [server] PHPStan version: PHPStan - PHP Static Analysis Tool 1.11.11

[8/20/2024, 4:03:33 PM] [check:1] Spawning PHPStan with the following configuration:  {"binStr":"/home/blah/bloh/vendor/bin/phpstan","args":["analyse","-c","/home/blah/bloh/phpstan.neon","--error-format=json","--no-interaction","--memory-limit=1G","-a","/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.1.14/_config/4f09c5c6606a8ac1b953d798f98a5522/autoload.php","-c","/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.1.14/_config/4f09c5c6606a8ac1b953d798f98a5522/config.neon"]}
[8/20/2024, 4:03:33 PM] [process-spawner] Spawning process 18094 with timeout 900000
[8/20/2024, 4:03:37 PM] [file-watcher] Checking: Initial check
[8/20/2024, 4:03:37 PM] [check:2] Check started for project
[8/20/2024, 4:03:37 PM] [check:1] Check completed for project, errors= {"fileSpecificErrors":{},"notFileSpecificErrors":[]}
[8/20/2024, 4:03:37 PM] [check:2] Spawning PHPStan with the following configuration:  {"binStr":"/home/blah/bloh/vendor/bin/phpstan","args":["analyse","-c","/home/blah/bloh/phpstan.neon","--error-format=json","--no-interaction","--memory-limit=1G","-a","/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.1.14/_config/4f09c5c6606a8ac1b953d798f98a5522/autoload.php","-c","/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.1.14/_config/4f09c5c6606a8ac1b953d798f98a5522/config.neon"]}
[8/20/2024, 4:03:37 PM] [process-spawner] Spawning process 18222 with timeout 900000
[8/20/2024, 4:03:41 PM] [check:2] PHPStan process exited succesfully
[8/20/2024, 4:03:41 PM] [status-bar] Hiding status bar, last operation result = Success
[8/20/2024, 4:03:41 PM] [check:2] Check completed for project, errors= {"fileSpecificErrors":{},"notFileSpecificErrors":[]}
[8/20/2024, 4:03:56 PM] [file-watcher] Checking: Hover action
[8/20/2024, 4:03:56 PM] [fixer-manager] No file changes, not checking
[8/20/2024, 4:04:00 PM] [file-watcher] Checking: Hover action
[8/20/2024, 4:04:00 PM] [fixer-manager] No file changes, not checking
[8/20/2024, 4:04:01 PM] [file-watcher] Checking: Document saved
[8/20/2024, 4:04:01 PM] [check:3] Check started for project
[8/20/2024, 4:04:01 PM] [status-bar] Showing status bar
[8/20/2024, 4:04:01 PM] [check:3] Spawning PHPStan with the following configuration:  {"binStr":"/home/blah/bloh/vendor/bin/phpstan","args":["analyse","-c","/home/blah/bloh/phpstan.neon","--error-format=json","--no-interaction","--memory-limit=1G","-a","/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.1.14/_config/4f09c5c6606a8ac1b953d798f98a5522/autoload.php","-c","/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.1.14/_config/4f09c5c6606a8ac1b953d798f98a5522/config.neon"]}
[8/20/2024, 4:04:01 PM] [process-spawner] Spawning process 18337 with timeout 900000
[8/20/2024, 4:04:04 PM] [file-watcher] Checking: Hover action
[8/20/2024, 4:04:04 PM] [fixer-manager] No file changes, not checking
[8/20/2024, 4:04:04 PM] [hover-provider] Hovering, no type found
[8/20/2024, 4:04:05 PM] [file-watcher] Checking: Document saved
[8/20/2024, 4:04:05 PM] [check:4] Check started for project
[8/20/2024, 4:04:05 PM] [check:3] Check completed for project, errors= {"fileSpecificErrors":{},"notFileSpecificErrors":[]}
[8/20/2024, 4:04:05 PM] [check:4] Spawning PHPStan with the following configuration:  {"binStr":"/home/blah/bloh/vendor/bin/phpstan","args":["analyse","-c","/home/blah/bloh/phpstan.neon","--error-format=json","--no-interaction","--memory-limit=1G","-a","/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.1.14/_config/4f09c5c6606a8ac1b953d798f98a5522/autoload.php","-c","/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.1.14/_config/4f09c5c6606a8ac1b953d798f98a5522/config.neon"]}
[8/20/2024, 4:04:05 PM] [process-spawner] Spawning process 18376 with timeout 900000
[8/20/2024, 4:04:06 PM] [file-watcher] Checking: Hover action
[8/20/2024, 4:04:06 PM] [fixer-manager] No file changes, not checking
[8/20/2024, 4:04:06 PM] [hover-provider] Hovering, no type found
[8/20/2024, 4:04:09 PM] [file-watcher] Checking: Document saved
[8/20/2024, 4:04:09 PM] [check:5] Check started for project
[8/20/2024, 4:04:09 PM] [check:4] Check completed for project, errors= {"fileSpecificErrors":{},"notFileSpecificErrors":[]}
[8/20/2024, 4:04:09 PM] [check:5] Spawning PHPStan with the following configuration:  {"binStr":"/home/blah/bloh/vendor/bin/phpstan","args":["analyse","-c","/home/blah/bloh/phpstan.neon","--error-format=json","--no-interaction","--memory-limit=1G","-a","/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.1.14/_config/4f09c5c6606a8ac1b953d798f98a5522/autoload.php","-c","/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.1.14/_config/4f09c5c6606a8ac1b953d798f98a5522/config.neon"]}
[8/20/2024, 4:04:09 PM] [process-spawner] Spawning process 18415 with timeout 900000
[8/20/2024, 4:04:21 PM] [check:5] PHPStan process exited succesfully
[8/20/2024, 4:04:21 PM] [status-bar] Hiding status bar, last operation result = Success
[8/20/2024, 4:04:21 PM] [check:5] Check completed for project, errors= {"fileSpecificErrors":{"file:///home/blah/bloh/www/includes/Models/XXX.php":["Class xxxx not found."]},"notFileSpecificErrors":[]}
SanderRonde commented 2 months ago

Alright I've finally managed to reproduce the problem and I've concluded that it's not really the fault of the extension but just the fault of PHPStan not properly cleaning up after itself. The reason for that conclusion is that even when the workers of 4+ previously-spawned PHPStan processes were still running, there was always just 1 parent process. This means the extension did kill the right process but PHPStan didn't pass along the kill signal to its workers. Even when just using a simple SIGINT and giving it any time it needs to pass along the signal, it doesn't.

So I've decided on another approach, which is just to look up the process tree, identify the child PIDs and kill them all manually alongside the parent. A bonus is that now the child PIDs are also stored in the zombie-killer. This zombie-killer comes into action when the editor launches (such as after a reload window), after which it will kill any PIDs that were previously registered as being PHPStan processes or workers. Previously this zombie killer would only try to kill the parent, but since it was the children that were the issue that didn't help.

I've attached a build of the extension where the issue should be fixed (at least it was for me). If any of you could give it a try I'd greatly appreciate that!

phpstan-vscode-3.1.14.zip

martijn-dd commented 2 months ago

Thank you. I'm gonna try it today with the new version.

momala454 commented 2 months ago

it doesn't work properly, it is stuck at 100% image

but it looks to work anyway, with just the message stuck

edit: now I also saw multiple times this message, which I didn't saw before image

momala454 commented 2 months ago

by the way, when i modify phpstan.neon, it doesn't trigger a change, I must modify anything in the files to trigger a phpstan check

martijn-dd commented 2 months ago

So far I don't have php processes stack up anymore. Yesterday kept the Activity Monitor open and the php processes were all closed after the timeout. For me all seems to work good now.

SanderRonde commented 2 months ago

it doesn't work properly, it is stuck at 100%

Ah yeah that was indeed a bit buggy, fixed it.

by the way, when i modify phpstan.neon, it doesn't trigger a change, I must modify anything in the files to trigger a phpstan check

Fixed this too.

Here's a new build. @momala454 if you can confirm that this works I'll release this fix and at least mark the non-docker part as done.

phpstan-vscode-3.1.14.zip

SanderRonde commented 2 months ago

And another one that includes docker-specific killing support (for anybody using docker willing to check):

phpstan-vscode-3.1.14.zip

If not I'll just ship this after shipping the other changes.

momala454 commented 2 months ago

hi @SanderRonde Thanks, it looks to have fixed the problems

momala454 commented 2 months ago

actually, the status bar is ok, but i still have this issue image

SanderRonde commented 2 months ago

(maybe a stupid question but) could it be that it's correct? That your checks are actually timing out? How long does a check take when performed on the command line with no cache?

momala454 commented 2 months ago

after clearing the cache (vendor/bin/phpstan clear-result-cache) time vendor/bin/phpstan analyse -c phpstan.neon

real    0m45.646s
user    6m0.004s
sys     0m7.522s

and when running it again :

real    0m1.601s
user    0m1.275s
sys     0m0.182s

If I modify the code to add an issue, it takes only a few seconds to show me on vscode the issue reported by phpstan. And the hover text is correct. Then no popup for timeout shown.

However, if I do multiple modifications quickly and save between each of them, I do see the timeout popup, but the error i've added is still correctly reported (before the popup). So when you kill the process, it's still counting the time spent for the killed processes and show a timeout error when it's been X seconds

SanderRonde commented 2 months ago

Ahh that makes sense, thanks for checking. Will look into that.

momala454 commented 2 months ago

Hey, another small problem unrelated. Doing a search / replace does not triger phpstan check

SanderRonde commented 2 months ago

Hey, another small problem unrelated. Doing a search / replace does not triger phpstan check

Hmm this is actually surprisingly hard to fix. What the extension currently does is that watches all open editors and, if VSCode signals that one of them changed, queues a new check if it's a PHP file.

I could switch this to watching for file changes workspace-wide, but then the issue becomes when to trigger a check and when not to. For example a change in vendor/ shouldn't trigger one, but one in index.php should. You'd probably say "just read it from the phpstan config" but that's first of all relatively hard to parse (.neon is a file-format that's barely being used) and it's not trivial to match 1:1 what PHPStan's known list of files is. It's probably an imperfect solution but I'd suggest for now to either run a manual full-project check (> PHPStan: scan project for errors) or to use PHPStan Pro, which does include such features since it runs inside of PHPStan.

(for the future: maybe nicer to open a separate issue for this, that also allows people who have the same question to find it, while allowing me to more clearly signal the status of the issue by marking it as closed/completed etc)

momala454 commented 2 months ago

it doesn't seem to be fixed, and not just about a timeout message

ps aux | grep sander -c 
30
ps aux | grep sander -c 
5

it was very slow to process. I made modifications to multiples files (and saved)

SanderRonde commented 2 months ago

I've fixed the timeout issue at least.

Regarding the number of processes, I kind of have no idea what to do at this point. I kill the PHPStan process and find any children and kill those too. If that still leaves some lingering processes it's likely to do with PHPStan ignoring kill commands or not cleaning up properly. The only alternative at this point is to pkill anything containing sanderronde but that's quite dangerous if you're running two instances of VSCode that are both scanning, or if somehow a process contains that string.

I'll just release what I've got right now and see if this improves the situation. @momala454 can you double check whether you're using the versions I posted and not the store version? I'll be releasing this one now so in a bit you'll also be able to use the store version to test.

SanderRonde commented 2 months ago

Published as 3.2.0. Can you check whether you run into the issue still? If not I'll (finally) close this issue

momala454 commented 2 months ago

Hello, thanks for the update. It seems to fix the notification problem, but i still have 27 process open sometimes. Here is the log, it looks like it spawned multiple times phpstan. Version 3.2.4

[9/9/2024, 8:54:08 AM] [client] Starting extension with configuration: {
    "phpstan.singleFileMode": false,
    "phpstan.binPath": "vendor/bin/phpstan",
    "phpstan.binCommand": [],
    "phpstan.configFile": "phpstan.neon,phpstan.neon.dist,phpstan.dist.neon",
    "phpstan.paths": {},
    "phpstan.dockerContainerName": "",
    "phpstan.rootDir": "",
    "phpstan.options": [],
    "phpstan.enableStatusBar": true,
    "phpstan.memoryLimit": "1G",
    "phpstan.enabled": true,
    "phpstan.projectTimeout": 300000,
    "phpstan.timeout": 300000,
    "phpstan.suppressTimeoutMessage": false,
    "phpstan.showProgress": false,
    "phpstan.enableLanguageServer": true,
    "phpstan.ignoreErrors": [],
    "phpstan.suppressWorkspaceMessage": false,
    "phpstan.pro": false,
    "phpstan.tmpDir": "",
    "phpstan.checkValidity": false
}
[9/9/2024, 8:54:08 AM] [client] Initializing done
[9/9/2024, 8:54:08 AM] [client] Showing one-time messages (if needed)
[9/9/2024, 8:54:08 AM] [server] Language server ready
[9/9/2024, 8:54:08 AM] [server] Language server started
[9/9/2024, 8:54:08 AM] [file-watcher] Checking: New document active active
[9/9/2024, 8:54:08 AM] [check:1] Check started for project
[9/9/2024, 8:54:08 AM] [status-bar] notification:' {"opId":0,"type":"new","tooltip":"Checking project"}
[9/9/2024, 8:54:08 AM] [status-bar] Showing status bar
[9/9/2024, 8:54:09 AM] [server] PHPStan version: PHPStan - PHP Static Analysis Tool 1.12.1

[9/9/2024, 8:54:10 AM] [file-watcher] Checking: Config change
[9/9/2024, 8:54:10 AM] [check:2] Check started for project
[9/9/2024, 8:54:10 AM] [status-bar] notification:' {"opId":1,"type":"new","tooltip":"Checking project"}
[9/9/2024, 8:54:10 AM] [file-watcher] Checking: Config change
[9/9/2024, 8:54:10 AM] [check:3] Check started for project
[9/9/2024, 8:54:10 AM] [status-bar] notification:' {"opId":2,"type":"new","tooltip":"Checking project"}
[9/9/2024, 8:54:10 AM] [status-bar] notification:' {"opId":0,"result":"Canceled","type":"done"}
[9/9/2024, 8:54:10 AM] [check:1] Check completed for project, errors= {"fileSpecificErrors":{},"notFileSpecificErrors":[]}
[9/9/2024, 8:54:10 AM] [file-watcher] Checking: Config change
[9/9/2024, 8:54:10 AM] [check:4] Check started for project
[9/9/2024, 8:54:10 AM] [status-bar] notification:' {"opId":3,"type":"new","tooltip":"Checking project"}
[9/9/2024, 8:54:10 AM] [status-bar] notification:' {"opId":1,"result":"Canceled","type":"done"}
[9/9/2024, 8:54:10 AM] [check:2] Check completed for project, errors= {"fileSpecificErrors":{},"notFileSpecificErrors":[]}
[9/9/2024, 8:54:10 AM] [diagnose-get-files] Spawning PHPStan with the following configuration:  {"binStr":"/home/bla/vendor/bin/phpstan","args":["diagnose","-c","/home/bla/phpstan.neon","-a","/home/bla/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.4/_config/4f09c5c6606a8ac1b953d798f98a5522/autoload.php","-c","/home/bla/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.4/_config/4f09c5c6606a8ac1b953d798f98a5522/config.neon"]}
[9/9/2024, 8:54:10 AM] [status-bar] notification:' {"opId":2,"result":"Canceled","type":"done"}
[9/9/2024, 8:54:10 AM] [check:3] Check completed for project, errors= {"fileSpecificErrors":{},"notFileSpecificErrors":[]}
[9/9/2024, 8:54:10 AM] [check:4] Spawning PHPStan with the following configuration:  {"binStr":"/home/bla/vendor/bin/phpstan","args":["analyse","-c","/home/bla/phpstan.neon","--error-format=json","--no-interaction","--memory-limit=1G","-a","/home/bla/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.4/_config/4f09c5c6606a8ac1b953d798f98a5522/autoload.php","-c","/home/bla/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.4/_config/4f09c5c6606a8ac1b953d798f98a5522/config.neon"]}
[9/9/2024, 8:54:14 AM] [file-watcher] Checking: Initial check
[9/9/2024, 8:54:14 AM] [check:5] Check started for project
[9/9/2024, 8:54:14 AM] [status-bar] notification:' {"opId":4,"type":"new","tooltip":"Checking project"}
[9/9/2024, 8:54:14 AM] [check:5] Spawning PHPStan with the following configuration:  {"binStr":"/home/bla/vendor/bin/phpstan","args":["analyse","-c","/home/bla/phpstan.neon","--error-format=json","--no-interaction","--memory-limit=1G","-a","/home/bla/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.4/_config/4f09c5c6606a8ac1b953d798f98a5522/autoload.php","-c","/home/bla/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.4/_config/4f09c5c6606a8ac1b953d798f98a5522/config.neon"]}
[9/9/2024, 8:54:16 AM] [diagnose-get-files] PHPStan process exited succesfully
[9/9/2024, 8:54:18 AM] [status-bar] notification:' {"progress":{"done":0,"total":1885,"percentage":0},"opId":4,"type":"progress","tooltip":"Checking project - 0/1885 (0%)"}
[9/9/2024, 8:54:22 AM] [status-bar] notification:' {"progress":{"done":200,"total":1885,"percentage":10},"opId":4,"type":"progress","tooltip":"Checking project - 200/1885 (10%)"}
[9/9/2024, 8:54:22 AM] [status-bar] notification:' {"progress":{"done":380,"total":1885,"percentage":20},"opId":4,"type":"progress","tooltip":"Checking project - 380/1885 (20%)"}
[9/9/2024, 8:54:29 AM] [status-bar] notification:' {"progress":{"done":660,"total":1885,"percentage":35},"opId":4,"type":"progress","tooltip":"Checking project - 660/1885 (35%)"}
[9/9/2024, 8:54:58 AM] [status-bar] notification:' {"progress":{"done":1120,"total":1885,"percentage":59},"opId":4,"type":"progress","tooltip":"Checking project - 1120/1885 (59%)"}
[9/9/2024, 8:55:03 AM] [status-bar] notification:' {"progress":{"done":1160,"total":1885,"percentage":61},"opId":4,"type":"progress","tooltip":"Checking project - 1160/1885 (61%)"}
[9/9/2024, 8:55:08 AM] [status-bar] notification:' {"progress":{"done":1200,"total":1885,"percentage":63},"opId":4,"type":"progress","tooltip":"Checking project - 1200/1885 (63%)"}
[9/9/2024, 8:55:17 AM] [status-bar] notification:' {"progress":{"done":1240,"total":1885,"percentage":65},"opId":4,"type":"progress","tooltip":"Checking project - 1240/1885 (65%)"}
[9/9/2024, 8:55:21 AM] [status-bar] notification:' {"progress":{"done":1340,"total":1885,"percentage":71},"opId":4,"type":"progress","tooltip":"Checking project - 1340/1885 (71%)"}
[9/9/2024, 8:55:38 AM] [status-bar] notification:' {"progress":{"done":1885,"total":1885,"percentage":100},"opId":4,"type":"progress","tooltip":"Checking project - 1885/1885 (100%)"}
[9/9/2024, 8:55:41 AM] [check:5] PHPStan process exited succesfully
[9/9/2024, 8:55:42 AM] [status-bar] notification:' {"opId":4,"result":"Success","type":"done"}
[9/9/2024, 8:55:42 AM] [status-bar] Hiding status bar, last operation result = Success
[9/9/2024, 8:55:42 AM] [check:5] Check completed for project, errors= {"fileSpecificErrors":{"file:///home/bla/www/subscriptions.php":["Dumped type: mixed"]},"notFileSpecificErrors":[]}
[9/9/2024, 8:55:42 AM] [diagnose-get-files] Spawning PHPStan with the following configuration:  {"binStr":"/home/bla/vendor/bin/phpstan","args":["diagnose","-c","/home/bla/phpstan.neon","-a","/home/bla/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.4/_config/4f09c5c6606a8ac1b953d798f98a5522/autoload.php","-c","/home/bla/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.4/_config/4f09c5c6606a8ac1b953d798f98a5522/config.neon"]}
[9/9/2024, 8:55:44 AM] [diagnose-get-files] PHPStan process exited succesfully
SanderRonde commented 2 months ago

Hmm is there anything particular about your setup? Are you running inside docker or something? And which linux distro are you using with WSL? I'm hoping to replicate the issue so I can more easily fix it. Maybe the killing-commands aren't available for some reason? Are kill and ps available?

It did indeed spawn multiple times but if I look at the logs it does seem like the last instance was killed every time before starting a new one.

momala454 commented 2 months ago

judging by the logs "check:4" have not been killed/finished ? and check 4 and 5 are started before "diagnose-get-files" process have finished, it is normal ?

i'm using ubuntu on wsl

kill and ps are available

SanderRonde commented 2 months ago

I've made some changes that should hopefully fix the issue. Indeed you're right that check 4 has not been killed/finished. I'm guessing that has to do with a bunch of checks being started right after each other. I've now made sure that the flurry of checks on-launch is gone.

If it's still not fixed I'll give it one more try to replicate it myself but at this point I have no clue what the issue could be and how to replicate it without going through 100 cycles of "I've added some logging here can you test this on your machine again".

momala454 commented 2 months ago

thanks, it seems to work fine now. I will continue to test

nikuscs commented 2 months ago

This is accurate, restarting the IDE will not kill the previous processes and keep spawning new ones. I guess a cleanup is needed here indeed, maybe at the boot time of the extension. You can also notice this as it keeps spawning new "ports" for the local webserver when using the pro.

SanderRonde commented 2 months ago

Hmm there is code for this already here. Will take a look at why it's not working. Would you mind creating a separate issue for it? I don't think the root causes are related, and it limits discussion to only those who need/want to hear it :)

momala454 commented 2 months ago

i think that actually the process may be still there. After a composer update, a lot of files changed, and there was 27 sanderronde process started, probably due to a lot of file watcher change ? My guess is that when you kill the phpstan processes, they do not stop immediatly, or not at all

SanderRonde commented 2 months ago

Hmm I can't really think of a reason for the processes after a composer update. There's (no longer) a file watcher other than the one watching for changes in your opened files. So changes in vendor/ shouldn't trigger anything.

Indeed correct that the processes don't stop immediately. There's a bunch of code responsible for finding any of those unwilling-to-be-killed processes and forcefully killing them. But I'm kind of unsure of what to do next if even that is not working.

Can you consistently reproduce the problem? If so I can maybe make a debug build for you that adds some logging that'll help me investigate.

momala454 commented 2 months ago

yes i can reproduce. Doing composer update didn't trigger anything apparently, but then when i modify something, it goes back to 27 processes

I don't know why the log only mention a single phpstan process spawned

phpstan client Log file

[9/12/2024, 11:52:17 AM] [file-watcher] Checking: Document changed
[9/12/2024, 11:52:17 AM] [check:77] Check started for project
[9/12/2024, 11:52:17 AM] [status-bar] notification:' {"opId":76,"type":"new","tooltip":"Checking project"}
[9/12/2024, 11:52:17 AM] [status-bar] Showing status bar
[9/12/2024, 11:52:17 AM] [check:77] Spawning PHPStan with the following configuration:  {"binStr":"/home/blah/blah/blah/vendor/bin/phpstan","args":["analyse","-c","/home/blah/blah/blah/phpstan.neon","--error-format=json","--no-interaction","--memory-limit=1G","-a","/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/autoload.php","-c","/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/config.neon"]}
[9/12/2024, 11:52:21 AM] [status-bar] notification:' {"progress":{"done":0,"total":1891,"percentage":0},"opId":76,"type":"progress","tooltip":"Checking project - 0/1891 (0%)"}
[9/12/2024, 11:52:24 AM] [status-bar] notification:' {"progress":{"done":20,"total":1891,"percentage":1},"opId":76,"type":"progress","tooltip":"Checking project - 20/1891 (1%)"}
[9/12/2024, 11:52:24 AM] [status-bar] notification:' {"progress":{"done":200,"total":1891,"percentage":10},"opId":76,"type":"progress","tooltip":"Checking project - 200/1891 (10%)"}
[9/12/2024, 11:52:24 AM] [status-bar] notification:' {"progress":{"done":380,"total":1891,"percentage":20},"opId":76,"type":"progress","tooltip":"Checking project - 380/1891 (20%)"}
[9/12/2024, 11:52:25 AM] [status-bar] notification:' {"progress":{"done":580,"total":1891,"percentage":30},"opId":76,"type":"progress","tooltip":"Checking project - 580/1891 (30%)"}
[9/12/2024, 11:52:25 AM] [status-bar] notification:' {"progress":{"done":640,"total":1891,"percentage":33},"opId":76,"type":"progress","tooltip":"Checking project - 640/1891 (33%)"}
[9/12/2024, 11:52:27 AM] [status-bar] notification:' {"progress":{"done":660,"total":1891,"percentage":34},"opId":76,"type":"progress","tooltip":"Checking project - 660/1891 (34%)"}
[9/12/2024, 11:52:28 AM] [status-bar] notification:' {"progress":{"done":680,"total":1891,"percentage":35},"opId":76,"type":"progress","tooltip":"Checking project - 680/1891 (35%)"}
[9/12/2024, 11:52:30 AM] [status-bar] notification:' {"progress":{"done":700,"total":1891,"percentage":37},"opId":76,"type":"progress","tooltip":"Checking project - 700/1891 (37%)"}
[9/12/2024, 11:52:31 AM] [status-bar] notification:' {"progress":{"done":740,"total":1891,"percentage":39},"opId":76,"type":"progress","tooltip":"Checking project - 740/1891 (39%)"}
[9/12/2024, 11:52:33 AM] [status-bar] notification:' {"progress":{"done":760,"total":1891,"percentage":40},"opId":76,"type":"progress","tooltip":"Checking project - 760/1891 (40%)"}
[9/12/2024, 11:52:36 AM] [status-bar] notification:' {"progress":{"done":800,"total":1891,"percentage":42},"opId":76,"type":"progress","tooltip":"Checking project - 800/1891 (42%)"}
[9/12/2024, 11:52:37 AM] [status-bar] notification:' {"progress":{"done":820,"total":1891,"percentage":43},"opId":76,"type":"progress","tooltip":"Checking project - 820/1891 (43%)"}
[9/12/2024, 11:52:38 AM] [status-bar] notification:' {"progress":{"done":880,"total":1891,"percentage":46},"opId":76,"type":"progress","tooltip":"Checking project - 880/1891 (46%)"}
[9/12/2024, 11:52:39 AM] [status-bar] notification:' {"progress":{"done":900,"total":1891,"percentage":47},"opId":76,"type":"progress","tooltip":"Checking project - 900/1891 (47%)"}
[9/12/2024, 11:52:42 AM] [status-bar] notification:' {"progress":{"done":920,"total":1891,"percentage":48},"opId":76,"type":"progress","tooltip":"Checking project - 920/1891 (48%)"}
[9/12/2024, 11:52:42 AM] [status-bar] notification:' {"progress":{"done":940,"total":1891,"percentage":49},"opId":76,"type":"progress","tooltip":"Checking project - 940/1891 (49%)"}
[9/12/2024, 11:52:44 AM] [status-bar] notification:' {"progress":{"done":960,"total":1891,"percentage":50},"opId":76,"type":"progress","tooltip":"Checking project - 960/1891 (50%)"}
[9/12/2024, 11:52:45 AM] [status-bar] notification:' {"progress":{"done":1020,"total":1891,"percentage":53},"opId":76,"type":"progress","tooltip":"Checking project - 1020/1891 (53%)"}
[9/12/2024, 11:52:48 AM] [status-bar] notification:' {"progress":{"done":1040,"total":1891,"percentage":54},"opId":76,"type":"progress","tooltip":"Checking project - 1040/1891 (54%)"}
[9/12/2024, 11:52:50 AM] [status-bar] notification:' {"progress":{"done":1060,"total":1891,"percentage":56},"opId":76,"type":"progress","tooltip":"Checking project - 1060/1891 (56%)"}
[9/12/2024, 11:52:54 AM] [status-bar] notification:' {"progress":{"done":1080,"total":1891,"percentage":57},"opId":76,"type":"progress","tooltip":"Checking project - 1080/1891 (57%)"}
[9/12/2024, 11:52:55 AM] [status-bar] notification:' {"progress":{"done":1140,"total":1891,"percentage":60},"opId":76,"type":"progress","tooltip":"Checking project - 1140/1891 (60%)"}
[9/12/2024, 11:53:00 AM] [status-bar] notification:' {"progress":{"done":1160,"total":1891,"percentage":61},"opId":76,"type":"progress","tooltip":"Checking project - 1160/1891 (61%)"}
[9/12/2024, 11:53:04 AM] [status-bar] notification:' {"progress":{"done":1180,"total":1891,"percentage":62},"opId":76,"type":"progress","tooltip":"Checking project - 1180/1891 (62%)"}
[9/12/2024, 11:53:05 AM] [status-bar] notification:' {"progress":{"done":1200,"total":1891,"percentage":63},"opId":76,"type":"progress","tooltip":"Checking project - 1200/1891 (63%)"}
[9/12/2024, 11:53:07 AM] [status-bar] notification:' {"progress":{"done":1220,"total":1891,"percentage":64},"opId":76,"type":"progress","tooltip":"Checking project - 1220/1891 (64%)"}
[9/12/2024, 11:53:13 AM] [status-bar] notification:' {"progress":{"done":1240,"total":1891,"percentage":65},"opId":76,"type":"progress","tooltip":"Checking project - 1240/1891 (65%)"}
[9/12/2024, 11:53:17 AM] [status-bar] notification:' {"progress":{"done":1260,"total":1891,"percentage":66},"opId":76,"type":"progress","tooltip":"Checking project - 1260/1891 (66%)"}
[9/12/2024, 11:53:18 AM] [status-bar] notification:' {"progress":{"done":1280,"total":1891,"percentage":67},"opId":76,"type":"progress","tooltip":"Checking project - 1280/1891 (67%)"}
[9/12/2024, 11:53:22 AM] [status-bar] notification:' {"progress":{"done":1300,"total":1891,"percentage":68},"opId":76,"type":"progress","tooltip":"Checking project - 1300/1891 (68%)"}
[9/12/2024, 11:53:22 AM] [status-bar] notification:' {"progress":{"done":1320,"total":1891,"percentage":69},"opId":76,"type":"progress","tooltip":"Checking project - 1320/1891 (69%)"}
[9/12/2024, 11:53:22 AM] [status-bar] notification:' {"progress":{"done":1340,"total":1891,"percentage":70},"opId":76,"type":"progress","tooltip":"Checking project - 1340/1891 (70%)"}
[9/12/2024, 11:53:22 AM] [status-bar] notification:' {"progress":{"done":1360,"total":1891,"percentage":71},"opId":76,"type":"progress","tooltip":"Checking project - 1360/1891 (71%)"}
[9/12/2024, 11:53:25 AM] [status-bar] notification:' {"progress":{"done":1400,"total":1891,"percentage":74},"opId":76,"type":"progress","tooltip":"Checking project - 1400/1891 (74%)"}
[9/12/2024, 11:53:26 AM] [status-bar] notification:' {"progress":{"done":1480,"total":1891,"percentage":78},"opId":76,"type":"progress","tooltip":"Checking project - 1480/1891 (78%)"}
[9/12/2024, 11:53:26 AM] [status-bar] notification:' {"progress":{"done":1520,"total":1891,"percentage":80},"opId":76,"type":"progress","tooltip":"Checking project - 1520/1891 (80%)"}
[9/12/2024, 11:53:27 AM] [status-bar] notification:' {"progress":{"done":1620,"total":1891,"percentage":85},"opId":76,"type":"progress","tooltip":"Checking project - 1620/1891 (85%)"}
[9/12/2024, 11:53:28 AM] [status-bar] notification:' {"progress":{"done":1660,"total":1891,"percentage":87},"opId":76,"type":"progress","tooltip":"Checking project - 1660/1891 (87%)"}
[9/12/2024, 11:53:29 AM] [status-bar] notification:' {"progress":{"done":1700,"total":1891,"percentage":89},"opId":76,"type":"progress","tooltip":"Checking project - 1700/1891 (89%)"}
[9/12/2024, 11:53:29 AM] [status-bar] notification:' {"progress":{"done":1711,"total":1891,"percentage":90},"opId":76,"type":"progress","tooltip":"Checking project - 1711/1891 (90%)"}
[9/12/2024, 11:53:31 AM] [status-bar] notification:' {"progress":{"done":1731,"total":1891,"percentage":91},"opId":76,"type":"progress","tooltip":"Checking project - 1731/1891 (91%)"}
[9/12/2024, 11:53:31 AM] [status-bar] notification:' {"progress":{"done":1751,"total":1891,"percentage":92},"opId":76,"type":"progress","tooltip":"Checking project - 1751/1891 (92%)"}
[9/12/2024, 11:53:33 AM] [status-bar] notification:' {"progress":{"done":1771,"total":1891,"percentage":93},"opId":76,"type":"progress","tooltip":"Checking project - 1771/1891 (93%)"}
[9/12/2024, 11:53:34 AM] [status-bar] notification:' {"progress":{"done":1791,"total":1891,"percentage":94},"opId":76,"type":"progress","tooltip":"Checking project - 1791/1891 (94%)"}
[9/12/2024, 11:53:35 AM] [status-bar] notification:' {"progress":{"done":1811,"total":1891,"percentage":95},"opId":76,"type":"progress","tooltip":"Checking project - 1811/1891 (95%)"}
[9/12/2024, 11:53:37 AM] [status-bar] notification:' {"progress":{"done":1831,"total":1891,"percentage":96},"opId":76,"type":"progress","tooltip":"Checking project - 1831/1891 (96%)"}
[9/12/2024, 11:53:38 AM] [status-bar] notification:' {"progress":{"done":1851,"total":1891,"percentage":97},"opId":76,"type":"progress","tooltip":"Checking project - 1851/1891 (97%)"}
[9/12/2024, 11:53:40 AM] [status-bar] notification:' {"progress":{"done":1871,"total":1891,"percentage":98},"opId":76,"type":"progress","tooltip":"Checking project - 1871/1891 (98%)"}
[9/12/2024, 11:54:02 AM] [status-bar] notification:' {"progress":{"done":1891,"total":1891,"percentage":100},"opId":76,"type":"progress","tooltip":"Checking project - 1891/1891 (100%)"}
[9/12/2024, 11:54:08 AM] [check:77] PHPStan process exited succesfully
[9/12/2024, 11:54:08 AM] [status-bar] notification:' {"opId":76,"result":"Success","type":"done"}
[9/12/2024, 11:54:08 AM] [status-bar] Hiding status bar, last operation result = Success
[9/12/2024, 11:54:08 AM] [check:77] Check completed for project, errors= {"fileSpecificErrors":{"file:///home/blah/blah/blah/subscriptions.php":["Dumped type: mixed"]},"notFileSpecificErrors":[]}

process list

ps aux |grep sander
blah   12222 10.1  6.0 516588 427148 pts/1   S+   11:52   0:03 php /home/blah/blah/vendor/bin/phpstan analyse -c /home/blah/blah/phpstan.neon --error-format=json --no-interaction --memory-limit=1G -a /home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/autoload.php -c /home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/config.neon
blah   13777  0.0  0.0   2620   460 pts/1    S+   11:52   0:00 sh -c '/usr/bin/php8.3' -c '/etc/php/8.3/cli/php.ini' '/home/blah/blah/vendor/bin/phpstan' 'worker' --configuration '/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/config.neon' --autoload-file='/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/autoload.php' --memory-limit='1G' --port 33995 --identifier drm4nu3gl2 --
blah   13779 76.9  3.6 343020 256664 pts/1   R+   11:52   0:26 /usr/bin/php8.3 -c /etc/php/8.3/cli/php.ini /home/blah/blah/vendor/bin/phpstan worker --configuration /home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/config.neon --autoload-file=/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/autoload.php --memory-limit=1G --port 33995 --identifier drm4nu3gl2 --
blah   13780  0.0  0.0   2620   520 pts/1    S+   11:52   0:00 sh -c '/usr/bin/php8.3' -c '/etc/php/8.3/cli/php.ini' '/home/blah/blah/vendor/bin/phpstan' 'worker' --configuration '/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/config.neon' --autoload-file='/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/autoload.php' --memory-limit='1G' --port 33995 --identifier pbcw5vb62a --
blah   13781  0.0  0.0   2620   520 pts/1    S+   11:52   0:00 sh -c '/usr/bin/php8.3' -c '/etc/php/8.3/cli/php.ini' '/home/blah/blah/vendor/bin/phpstan' 'worker' --configuration '/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/config.neon' --autoload-file='/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/autoload.php' --memory-limit='1G' --port 33995 --identifier ai0hapoinb --
blah   13782 73.9  4.2 394220 304812 pts/1   R+   11:52   0:25 /usr/bin/php8.3 -c /etc/php/8.3/cli/php.ini /home/blah/blah/vendor/bin/phpstan worker --configuration /home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/config.neon --autoload-file=/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/autoload.php --memory-limit=1G --port 33995 --identifier pbcw5vb62a --
blah   13784  0.0  0.0   2620   524 pts/1    S+   11:52   0:00 sh -c '/usr/bin/php8.3' -c '/etc/php/8.3/cli/php.ini' '/home/blah/blah/vendor/bin/phpstan' 'worker' --configuration '/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/config.neon' --autoload-file='/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/autoload.php' --memory-limit='1G' --port 33995 --identifier 1mg0zjge6v --
blah   13785 70.9  4.4 402412 313256 pts/1   R+   11:52   0:24 /usr/bin/php8.3 -c /etc/php/8.3/cli/php.ini /home/blah/blah/vendor/bin/phpstan worker --configuration /home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/config.neon --autoload-file=/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/autoload.php --memory-limit=1G --port 33995 --identifier ai0hapoinb --
blah   13787 73.1  4.7 427052 336940 pts/1   R+   11:52   0:24 /usr/bin/php8.3 -c /etc/php/8.3/cli/php.ini /home/blah/blah/vendor/bin/phpstan worker --configuration /home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/config.neon --autoload-file=/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/autoload.php --memory-limit=1G --port 33995 --identifier 1mg0zjge6v --
blah   13788  0.0  0.0   2620   524 pts/1    S+   11:52   0:00 sh -c '/usr/bin/php8.3' -c '/etc/php/8.3/cli/php.ini' '/home/blah/blah/vendor/bin/phpstan' 'worker' --configuration '/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/config.neon' --autoload-file='/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/autoload.php' --memory-limit='1G' --port 33995 --identifier 97fhtt5ta3 --
blah   13794 74.0  3.8 363500 274068 pts/1   D+   11:52   0:25 /usr/bin/php8.3 -c /etc/php/8.3/cli/php.ini /home/blah/blah/vendor/bin/phpstan worker --configuration /home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/config.neon --autoload-file=/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/autoload.php --memory-limit=1G --port 33995 --identifier 97fhtt5ta3 --
blah   13795  0.0  0.0   2620   524 pts/1    S+   11:52   0:00 sh -c '/usr/bin/php8.3' -c '/etc/php/8.3/cli/php.ini' '/home/blah/blah/vendor/bin/phpstan' 'worker' --configuration '/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/config.neon' --autoload-file='/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/autoload.php' --memory-limit='1G' --port 33995 --identifier q1b1ckngm9 --
blah   13796  0.0  0.0   2620   456 pts/1    S+   11:52   0:00 sh -c '/usr/bin/php8.3' -c '/etc/php/8.3/cli/php.ini' '/home/blah/blah/vendor/bin/phpstan' 'worker' --configuration '/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/config.neon' --autoload-file='/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/autoload.php' --memory-limit='1G' --port 33995 --identifier 9e4w9v3gv7 --
blah   13797 74.1  4.3 402412 311572 pts/1   R+   11:52   0:25 /usr/bin/php8.3 -c /etc/php/8.3/cli/php.ini /home/blah/blah/vendor/bin/phpstan worker --configuration /home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/config.neon --autoload-file=/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/autoload.php --memory-limit=1G --port 33995 --identifier q1b1ckngm9 --
blah   13798 70.6  3.7 357360 267796 pts/1   R+   11:52   0:24 /usr/bin/php8.3 -c /etc/php/8.3/cli/php.ini /home/blah/blah/vendor/bin/phpstan worker --configuration /home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/config.neon --autoload-file=/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/autoload.php --memory-limit=1G --port 33995 --identifier 9e4w9v3gv7 --
blah   13799  0.0  0.0   2620   520 pts/1    S+   11:52   0:00 sh -c '/usr/bin/php8.3' -c '/etc/php/8.3/cli/php.ini' '/home/blah/blah/vendor/bin/phpstan' 'worker' --configuration '/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/config.neon' --autoload-file='/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/autoload.php' --memory-limit='1G' --port 33995 --identifier 5h359vw71r --
blah   13801 70.3  4.4 404460 315592 pts/1   R+   11:52   0:23 /usr/bin/php8.3 -c /etc/php/8.3/cli/php.ini /home/blah/blah/vendor/bin/phpstan worker --configuration /home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/config.neon --autoload-file=/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/autoload.php --memory-limit=1G --port 33995 --identifier 5h359vw71r --
blah   13802  0.0  0.0   2620   456 pts/1    S+   11:52   0:00 sh -c '/usr/bin/php8.3' -c '/etc/php/8.3/cli/php.ini' '/home/blah/blah/vendor/bin/phpstan' 'worker' --configuration '/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/config.neon' --autoload-file='/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/autoload.php' --memory-limit='1G' --port 33995 --identifier ke8684jufg --
blah   13804 81.5  4.1 388460 293712 pts/1   R+   11:52   0:27 /usr/bin/php8.3 -c /etc/php/8.3/cli/php.ini /home/blah/blah/vendor/bin/phpstan worker --configuration /home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/config.neon --autoload-file=/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/autoload.php --memory-limit=1G --port 33995 --identifier ke8684jufg --
blah   13805  0.0  0.0   2620   520 pts/1    S+   11:52   0:00 sh -c '/usr/bin/php8.3' -c '/etc/php/8.3/cli/php.ini' '/home/blah/blah/vendor/bin/phpstan' 'worker' --configuration '/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/config.neon' --autoload-file='/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/autoload.php' --memory-limit='1G' --port 33995 --identifier op0xrthtuy --
blah   13806  0.0  0.0   2620   456 pts/1    S+   11:52   0:00 sh -c '/usr/bin/php8.3' -c '/etc/php/8.3/cli/php.ini' '/home/blah/blah/vendor/bin/phpstan' 'worker' --configuration '/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/config.neon' --autoload-file='/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/autoload.php' --memory-limit='1G' --port 33995 --identifier up2varrnrg --
blah   13807 68.4  4.3 402348 312428 pts/1   R+   11:52   0:23 /usr/bin/php8.3 -c /etc/php/8.3/cli/php.ini /home/blah/blah/vendor/bin/phpstan worker --configuration /home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/config.neon --autoload-file=/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/autoload.php --memory-limit=1G --port 33995 --identifier op0xrthtuy --
blah   13809  0.0  0.0   2620   524 pts/1    S+   11:52   0:00 sh -c '/usr/bin/php8.3' -c '/etc/php/8.3/cli/php.ini' '/home/blah/blah/vendor/bin/phpstan' 'worker' --configuration '/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/config.neon' --autoload-file='/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/autoload.php' --memory-limit='1G' --port 33995 --identifier 7ooh4dyyx4 --
blah   13811 72.4  3.7 359404 268272 pts/1   R+   11:52   0:24 /usr/bin/php8.3 -c /etc/php/8.3/cli/php.ini /home/blah/blah/vendor/bin/phpstan worker --configuration /home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/config.neon --autoload-file=/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/autoload.php --memory-limit=1G --port 33995 --identifier up2varrnrg --
blah   13812 72.5  3.8 367596 276540 pts/1   R+   11:52   0:24 /usr/bin/php8.3 -c /etc/php/8.3/cli/php.ini /home/blah/blah/vendor/bin/phpstan worker --configuration /home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/config.neon --autoload-file=/home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/_config/4f09c5c6606a8ac1b953d798f98a5522/autoload.php --memory-limit=1G --port 33995 --identifier 7ooh4dyyx4 --
blah   76150  5.6  1.1 1088552 79800 pts/1   Sl+  09:18   8:47 /home/blah/.vscode-server/bin/4849ca9bdf9666755eb463db297b69e5385090e3/node /home/blah/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.7/out/server.js --node-ipc --clientProcessId=76112