For me it’s not the .sonarlinttmp folders but literally 8600 known-findings-store folders, adding up to nearly 43 gig. I am using the VSCode extension, version 4.15.0.
I do work on a number of fairly large repos, and am one of those too-many-tabs people, but still. One interesting thing is that I resorted by date modified, and the oldest of those folders is only 3 days old. That’s a lot of findings for three days!
EDIT: It’s 5 minutes later, and the oldest handful of known findings folders disappeared, with the oldest again 3 days old… but, like, exactly three days, to the minute. So clearly y’all are pruning. Maybe 72 hours is too much, though.
Thanks for reporting here. I’m surprised that you have so many folders. How do you usually exit from VSCode? Do you close it normally or do you kill it?
The extension is supposed to clean things up before exiting. Could you try another time and confirm that when you open VSCode, a new folder is created, and when you close it gracefully, it stays there?
Seriously, though, if exiting VSCode is the primary clean up time, that would def explain how they accumulate. The only time I ever quit VSCode is if it has an update and needs to be restarted or when I restart my machine (which I think my company forces… once a month, maybe?). Also very occasionally if VSCode is really acting up (taking a full minute to save, for example), I’ll restart it. Otherwise, it is always running.
That said, the 72-hour cleanup seems to happen whenever the extension activates. Just now, there were 16 folders labeled Feb 2, 10:33 pm, and while they didn’t disappear the moment the clock hit 10:33 (nor yet 10:34), they did disappear as soon as I switched to VSCode, added and deleted a newline, and saved the file (which I presume triggered SonarlLint to run).
So could whatever routine enforces the 72-hour limit also force a max count limit? Or could the window be shortened? Out of curiosity, how are any of the folders older than the most recent one used?
No worries. I get it - the more info you have, the easier it is to fix!
You know that t-shirt that’s like, My brain has too many tabs? They’re going to put that on my tombstone. I currently have 6 VSCode windows open, with 13, 11, 5, 5, 19, and 96 tabs, respectively.
Okay, so I opened a window which had 19 tabs in it from the last time it was open. (So a total of 7 windows open.) The only folder that appeared in .sonarlint was an xodus-local-only-issue-store folder. Then I added and removed a newline and saved, and I got 6 known findings folders and a .sonarlinttmp folder. (UPDATE: Now while I’ve been writing this to you, three more known findings folders have appeared. VSCode is running in the background, but I didn’t switch to it during the time that they appeared.)
So I just switched back to VSCode and nothing happened. Switched windows, still nothing. Switched branches, and 5 more known findings folders appeared. This is maybe another clue. I rebase constantly, flip flop between branches, rename them, push and pop commits off the top of them, reset them, and otherwise mess about in git all day. (I swear, there’s a method to the madness.) (Also, while I’ve been typing this answer to question 3, another 3 known findings folders have appeared. Oh, and just now another three… Oh, interesting - they seem to be coming at 5-minute intervals. <waits 5 minutes> Yup, here are another 3.)
I just closed that same 7th window that I’d opened, and both the xodus-local-only-issue-store folder and the .sonarlinttmp folder I mentioned before disappeared, but none of the known findings ones did. Also, a new folder called storage appeared.
I work primarily in Python, but also a bit in TS. Then there’s always the odd config file, some JSON, some plain text… Lemme actually see what I have open right now… Okay, in among all of those open tabs, there’s python, yml, json, txt, toml, md, rust, bash, gitconfig and gitignore, env, and html. But the vast, vast majority of the changes that are getting made and the tabs which are focused are python. (Meanwhile, two more sets of 3 known findings folders have appeared, still at 5 minute intervals, and just now 6 new .sonarlinttmp folders appeared.)
(bonus) Just noticed that VSCode had an update, so I restarted it (using the Restart to Update command). When it shut down, all of the latest .sonarlinttmp folders disappeared, and 6 new known findings folders appeared, along with a storage folder. No known findings folders disappeared, though. When VSCode started back up, nothing happened. I waited for all of the extensions to load, the focused editor to be parsed and have its outline show up, the terminal to finish reloading, etc - across all 6 windows. Still no new folders. Then I came here to type this answer #6, and just now when I switched back to Finder… this had happened:
That’s VERY helpful, thanks for sharing all those details!
I still don’t reproduce the problem but I think I found one thing in the code that could lead to this. I will investigate further. Would you be able to install a custom build to validate the fix?
There is still one last thing that I don’t understand, it’s about the 5min period. There is no such period in any triggered task. Could you enable verbose logging, and check if there is any activity in the logs when new folders are created every 5min?
I made a fix so less folders should appear, and they should all be cleaned up when leaving VSCode. The new version was just released, could you please update and give it a try? Thanks!
Are you also using MacOS? Could you check if several folders appear for a single VSCode instance, or if is there only one created but it is not deleted when VSCode exits? I would also be interested in getting verbose logs, see instructions above
The temp folder was deleted, but as seen on the previous screenshot, it was already deleted event with vscode open. A new folder was created called storage and none of the folders were deleted. Folder has 17 items
<Can’t add printscreen of the storage folder as I’m blocked>
Language used is english
Extension sonarsource.sonarlint-vscode at version 4.20.2
could you run the jps command in a terminal and share the result with us? I’m interested to see if there are several instances of sonarlint-ls.jar running