dbcli / mssql-cli

A command-line client for SQL Server with auto-completion and syntax highlighting
BSD 3-Clause "New" or "Revised" License
1.35k stars 192 forks source link

man tmp files (pipe files) created and not deleted #460

Open aberezin opened 4 years ago

aberezin commented 4 years ago

I am running mssql-cli in a bash script in ubuntu and see hundreds of /tmp/foo files left lying around where foo is like clr-debug-pipe-29415-136842019-out clr-debug-pipe-29415-136842019-in

They are FIFO pipes I think, created by CLR.

pensivebrian commented 4 years ago

Thanks for reporting this. Can you try setting the following environment variable, and seeing if that prevents the temp files from being created?

export COMPlus_EnableDiagnostics=0

If that works, we can roll that into the mssql-cli bootstrap/startup as a permanent fix.

caputchinefrobles commented 4 years ago

I can confirm that COMPlus_EnableDiagnostics=0 works preventing clr-debug-pipe files of being created, but it does not prevent .tmp files. It actually triggered and incident today (full usage of tmp partition) because of these .tmp files. Is there anyway of preventing these as well?

sethcenterbar commented 3 years ago

Second this. I'm pulling hundreds of gigs onto a mounted drive on centos, yet our root drive was filling up. Found the clr files (not taking up much space) along with dozens of .tmp files that was up to 45G.

caputchinefrobles commented 3 years ago

@sethcenterbar I actually had to come up with a cron job to remove all tmp files but the most recent, which might be still being written.

sethcenterbar commented 3 years ago

Certainly not an ideal scenario. I'm assuming this is just a problem on linux?

On Thu, Jul 30, 2020 at 11:55 AM Bruno Oliveira notifications@github.com wrote:

@sethcenterbar https://github.com/sethcenterbar I actually had to come up with a cron job to remove all tmp files but the most recent, which might be still being written.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dbcli/mssql-cli/issues/460#issuecomment-666483458, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB54DXU4NSBGEE4DZODF64TR6GJXRANCNFSM4MNXAJNQ .

dargor commented 3 years ago

Got bit by this too, after a quick investigation with strace I found that these pesky tmp files are created by MicrosoftSqlToolsServiceLayer. I see a lot of open("tmpXXXXXX.tmp") with corresponding close and unlink. But unlink is sometimes missing (while close is present), which cause our problem here.

This is on Linux, of course. I do not have the dotnet skills to debug further. Maybe simply bump to a newer version would be enough ?