Giter Site home page Giter Site logo

Comments (12)

erichkuba avatar erichkuba commented on July 2, 2024 6

I've possibly been able to resolve this by pinning the @smithy/node-http-handler package (which is used internally by @AWS-SDK) to version 3.0.1

With this, I have been able to upgrade the @AWS-SDK packages to version ^3.600.0. This is not a long-term solution but provides a bridging solution until the root cause is addressed.

So, in short, add the following to your dependencies in your package.json file:

    "@smithy/node-http-handler": "3.0.1",

I've deployed this change into our systems and will monitor memory usage over the next few days, but the warning no longer presents.

I hope this is helpful.

from sqs-consumer.

erichkuba avatar erichkuba commented on July 2, 2024 5

After reviewing the impact of the above fix, it does appear that the leak has been resolved, so I'm happy to recommend it as a temporary solution until a more permanent fix is available.

SQS-Consumer-Memory-Leak-Fix

from sqs-consumer.

nicholasgriffintn avatar nicholasgriffintn commented on July 2, 2024

Hey, thanks for raising an issue.

3.6 of the sdk would be a major version, we don't naturally support major version releases as they come out as they come with breaking changes like this.

It would be something that we'd have to look at for our next major/minor release ourselves.

I am rather busy at the moment though, so I would suggest staying on 3.5 for a little while longer.

We'd be happy to take a pr though if this is an issue for anyone.

from sqs-consumer.

peter-asztalos-mf avatar peter-asztalos-mf commented on July 2, 2024

Hej, thanks for the quick response.

I can reproduce this issue just upgrading to 3.582.0 which if I understood correctly is part of 3.5, right? 🤔

I can look into it and open a PR. My fix during the test was very simple: passing new AbortController per request. Do you see any issue with that?

from sqs-consumer.

nicholasgriffintn avatar nicholasgriffintn commented on July 2, 2024

Ahh sorry, I thought you said it was 3.6, the pr you linked also seems like a breaking change to me.

If I have time I might be able to look into it. In terms of a possible solution, that might be if, I've not looked too deep though.

from sqs-consumer.

erichkuba avatar erichkuba commented on July 2, 2024

I'm having the same issue and can confirm that this is not just a warning but continues to leak until the process is out of memory.

from sqs-consumer.

nicholasgriffintn avatar nicholasgriffintn commented on July 2, 2024

If I have spare time this week I'll take a look, unfortunately, until then, I'd have to ask that everyone bares with.

If anyone has the time themselves to look, that'd be super helpful, but if not, you'll have to wait on me. Unfortunately, it has come at a particularly busy time for the BBC.

from sqs-consumer.

nicholasgriffintn avatar nicholasgriffintn commented on July 2, 2024

Awesome! So it is a change in the next version that causes the issue, that makes it easier to figure out what's going on, thanks!

(This one: https://github.com/smithy-lang/smithy-typescript/releases/tag/%40smithy/node-http-handler%403.1.0 which is the change mentioned at the top, spot on!)

from sqs-consumer.

nicholasgriffintn avatar nicholasgriffintn commented on July 2, 2024

On further research, this may be because the Aborts are not automatically being cleaned up, there's an old Node issue around this: nodejs/node#46525

Possibly because smithy is adding event listeners: https://github.com/smithy-lang/smithy-typescript/pull/1308/files#diff-98216b22e6b39a1cd6f2ab013304d4964152b554c4ad8fee4182a961b42285d8R192 but not removing them?

Update: I've opened an issue around this here: smithy-lang/smithy-typescript#1318

from sqs-consumer.

nicholasgriffintn avatar nicholasgriffintn commented on July 2, 2024

Update on this, I have published 11.0.0-canary.1 with the latest version of the aws-sdk to test this with that new version and I've made a new example that sets up Docker with localstack for a truer test: https://github.com/bbc/sqs-consumer-starter/tree/main/examples/docker

With this, I have replicated the issue:
Screenshot by Dropbox Capture

Still trying to figure out the best way to resolve it though.

from sqs-consumer.

joseamt avatar joseamt commented on July 2, 2024

@erichkuba Still I have the issue.

Node version : 18.20.2
"@aws-sdk/client-sqs": "^3.600.0",
"@ssut/nestjs-sqs": "^2.1.0",

Screenshot 2024-06-21 113538

I tried with @smithy/node-http-handler package and still the issue persists.

from sqs-consumer.

nicholasgriffintn avatar nicholasgriffintn commented on July 2, 2024

Hey, I'm still waiting on a response from AWS on the issue I raised above.

Outside of that, the current suggestion is to do what was described here: #500 (comment), or pin your AWS SDK version to before this change.

Outside of that, if anyone has any ideas for how it might be resolved in SQS Consumer, feel free to open a PR, we are in an election period at the moment, so I'm strapped for time.

Could we avoid adding "me too" comments though please? This just fills up the thread and makes it unreadable for other people coming in.

from sqs-consumer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.