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

SFTP resource leak leading to excessive node memory usage #224

Open
Szilard95 opened this issue Sep 8, 2023 · 1 comment
Open

SFTP resource leak leading to excessive node memory usage #224

Szilard95 opened this issue Sep 8, 2023 · 1 comment
Assignees

Comments

@Szilard95
Copy link

Hey there,
I really like the extension!

I was using it for longer sessions to edit files on my remote Linux node and I noticed that its memory usage was creeping up slowly. In the span of 4 hours more than 500 of these processes spawned and was kept around for as long as vscode was open. These were eating up around 2 GB of my node's RAM by the time I noticed:

/usr/sbin/tailscaled be-child ssh [...] --has-tty=false --tty-name= --sftp

I looked around a bit in the extension source - I see that ssh connections are cached in the SshConnectionManager but on each SFTP command a new SFTP session is created via new Sftp(conn) / conn.sftp. Every time any SFTP related action is performed in the node explorer a new process is spawned on the remote host. I messed around and tried explicitly closing the sftp sessions with sftp.end() that seemed to solve the issue (caching should also work).

I'm running Linux both locally and on the node, Tailscale v1.48.1, extension v0.6.2.

@tylersmalley
Copy link

Thanks for the report @Szilard95 - I have figured out the issue with the connection re-use and am working on a fix.

@tylersmalley tylersmalley self-assigned this Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants