got icon indicating copy to clipboard operation
got copied to clipboard

Possible function divergence in "request.setTimeout(0)"?

Open J9B10 opened this issue 1 year ago • 0 comments

What would you like to discuss?

I got here through a link in a Got file "timed-out.js".

I'm a beginner and just like a curious cat I found things in the archives.

About notice: // request.setTimeout(0) causes a memory leak.

Line 61: \got\dist\source\core\timed-out.js

I saw this warning about memory leak.

I looked more about the use of this function and found a file that uses this problematic function when using http2.

Line 659: \got\dist\source\core\index.js

This file "index.js" is using the function as specified as problematic "request.setTimeout(0)" on line 659.

So I don't understand if the code is correct or someone forgot to correct this function.

My application has a random memory leak that happens after a few hours of use by calling an external api using Got with http2 enabled.

Could this have to do with the memory leak I get?

Got 14.2.1 Node 22.2.0.0

I'm just a beginner in programming. I don't know if I'm posting this in the right or wrong place. Sorry for my English as I'm using automatic translators.

Checklist

  • [ ] I have read the documentation.
  • [x] I have use latest version of Got.
  • [x] I have use latest version of Node.

J9B10 avatar May 16 '24 15:05 J9B10