You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I recently updated my project (fastify server running on AWS) to Node 18 (previously Node 16). I'm experiencing something very strange: I have an unit test suite running with localstack (with lot of tests) and the same tests running succesfully with Node 16 now almost every time (but randomly) fail because it seems to me that the http connections to locastack service hang indefinitely, until my test suite timeout shut all down. I also experience that when this happen, my docker container automatically close before all tests are ended.
I experience also some strange timeouts on production mode, where I have a lot of interaction as http requests, database queries and sns publications: I particurarly experience strange timeouts on SNS publications (connections to SNS hang indefinitely) after 1-2 hours my server is running, and that eventually block the server which I must restart forcefully, beacause always more requests start to hang creating a sort of bottle neck.
I don't really know if the problem is with Node version, but I tried everything and I can say that both the test suite and the SNS publications never hang indefinitely with Node 16. As I switch to Node 18 I start to have the problem, starting simply with my unit tests.
The problem doesn't seem to reside on AWS or other libraries, because I also tried to mantain the same versions switching only Node, and the problem arise always only with version 18.
Do you have any idea of what could possibly be causing this? Did some node core http option change in Node 18 that may be causing this?
The problem occurs only with all Node 18 versions (I tried also the last one) and doesn't seem to occur either with Node greater versions, the 20 for example.
Node.js version
v.18
Operating system
Alpine Linux
The text was updated successfully, but these errors were encountered:
alesk20
changed the title
Upgrade from Node 16 to Node 18, http requests hanging indefinitely #4389
Upgrade from Node 16 to Node 18, http requests hanging indefinitely
May 7, 2024
trivikr
changed the title
Upgrade from Node 16 to Node 18, http requests hanging indefinitely
Upgrade from node 16 to node 18, http requests hanging indefinitely
May 10, 2024
I actually find out the problem, and it wasn't with nodejs version. It was actually the interaction with aws-sdk S3 client, it was not closing the socket connection if the s3 object body stream was not consumed, eventually leading to socket exhaustion.
The difference from node 16 and node 18 version was actually that I was also updating aws sdk version (the older s3 client did not return a stream for the S3 object body, so the problem never showed up).
Details
Hello, I recently updated my project (fastify server running on AWS) to Node 18 (previously Node 16). I'm experiencing something very strange: I have an unit test suite running with localstack (with lot of tests) and the same tests running succesfully with Node 16 now almost every time (but randomly) fail because it seems to me that the http connections to locastack service hang indefinitely, until my test suite timeout shut all down. I also experience that when this happen, my docker container automatically close before all tests are ended.
I experience also some strange timeouts on production mode, where I have a lot of interaction as http requests, database queries and sns publications: I particurarly experience strange timeouts on SNS publications (connections to SNS hang indefinitely) after 1-2 hours my server is running, and that eventually block the server which I must restart forcefully, beacause always more requests start to hang creating a sort of bottle neck.
I don't really know if the problem is with Node version, but I tried everything and I can say that both the test suite and the SNS publications never hang indefinitely with Node 16. As I switch to Node 18 I start to have the problem, starting simply with my unit tests.
The problem doesn't seem to reside on AWS or other libraries, because I also tried to mantain the same versions switching only Node, and the problem arise always only with version 18.
Do you have any idea of what could possibly be causing this? Did some node core http option change in Node 18 that may be causing this?
The problem occurs only with all Node 18 versions (I tried also the last one) and doesn't seem to occur either with Node greater versions, the 20 for example.
Node.js version
v.18
Operating system
Alpine Linux
The text was updated successfully, but these errors were encountered: