tim-kos/node-retry

[Bug] RetryOperation does not free errors correctly, causing "forever" operations to leak memory

atondelier opened this issue · 0 comments

Hi,

It appears to me that the following splice call

      // retry forever, only keep last error
      this._errors.splice(this._errors.length - 1, this._errors.length);

is not doing what it says it does. It actually only removes the last element of _errors.

Since it has been there for 3 years and nobody complaining about it, I prefer checking with you before if:

  • this is an intended behavior
  • splicing with a length of the length of the Array was expected to splice at the head of the Array
  • or if I'm just completely wrong

Thanks for the great work.