-
Notifications
You must be signed in to change notification settings - Fork 133
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
SNOW-992395: The lib leaks keepalive sockets when uploading files + using S3 client #734
Comments
hi - thank you for raising this issue and especially for providing a possible solution for it; the contribution is much appreciated! we'll take a look |
Thank you @GabrielLomba. It looks like a bug in our our sdk. I will take a look on your PR and add fix to next version. |
) Co-authored-by: Dawid Heyman <[email protected]>
checked why this issue was closed; apparently its PR was released in snowflake-sdk 1.9.3 |
@sfc-gh-pmotacki , I see the changes related to this issue were reverted in PR #747 (both client reuse and destruction) and are not present in the latest SDK version. The PR does not have any description so I have no idea why that was necessary. Can we reopen the issue in that case? Since the memory leak described still exists. |
Hi! I have a service running that uploads lots of files to a Snowflake stage to then insert the data into tables. The problem, however, is that there is a memory leak created by how the Snowflake SDK uses AWS S3 clients. There are many places where the SDK creates temporary clients (to name a few: here, here and here) but the SDK never calls
client.destroy()
on them (defined in the AWS SDK here).Each S3 client creates a http agent with keepalive sockets and those are just never destroyed, creating increasing memory usage over the time. While Node docs state that destroying an agent is usually not needed, for keepalive sockets (this case), it's best to do it explicitly and, in our experience, keepalive sockets pointing at AWS infrastructure stay alive for a really long time, enough to cause increasing memory usage.
I also noticed the SDK creates clients (for instance, here) and set them in
meta
but they're never reused in the respective util files when they could. PR to fix this has been created.What version of NodeJS driver are you using?
v1.9.0
What operating system and processor architecture are you using?
Ubuntu, x86_64
What version of NodeJS are you using?
v14.19.0
What are the component versions in the environment (
npm list
)?NA
Server version:* E.g. 1.90.1
NA
What did you do?
My service uploads lots of data files to Snowflake stage which is then inserted into tables.
What did you expect to see?
Controlled memory usage over a greater period of time.
What is your Snowflake account identifier, if any? (Optional)
NA
The text was updated successfully, but these errors were encountered: