nodejs / help

:sparkles: Need help with Node.js? File an Issue here. :rocket:
1.44k stars 276 forks source link

Upgrade from Node 16 to Node 18, http requests hanging indefinitely #4389

Closed alesk20 closed 1 month ago

alesk20 commented 1 month ago

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 with all Node 18 versions (I tried also the last one).

Node.js version

v.18

Operating system

Alpine Linux

alesk20 commented 1 month ago

Moved my issue here https://github.com/nodejs/node/issues/52871