node-retry icon indicating copy to clipboard operation
node-retry copied to clipboard

Check for infinity value in `retries`

Open fzn0x opened this issue 3 years ago • 2 comments

You can found the details at #58 too.

When we give retries Infinity value, it will produce this error

#
# Fatal error in , line 0
# Fatal JavaScript invalid size error 169220804
#
#
#
#FailureMessage Object: 0000007FAFAFD6C0
 1: 00007FF6B5CC30AF v8::internal::CodeObjectRegistry::~CodeObjectRegistry+112511
 2: 00007FF6B5BE023F v8::CFunctionInfo::HasOptions+7055
 3: 00007FF6B68B6392 V8_Fatal+162
 4: 00007FF6B6440153 v8::internal::FactoryBase<v8::internal::Factory>::NewFixedDoubleArray+259
 5: 00007FF6B62E8B73 v8::internal::FeedbackNexus::ic_state+60339
 6: 00007FF6B62FFBD0 v8::Message::GetIsolate+14688
 7: 00007FF6B6174711 v8::internal::CompilationCache::IsEnabledScriptAndEval+26849
 8: 00007FF6B6612541 v8::internal::SetupIsolateDelegate::SetupHeap+494417
 9: 000001FE08B399D9

Work around:

  await pRetry(run, {
    retries: Infinity,
    onFailedAttempt: () => {
      console.log("Retrying..");
    },
  });
"p-retry": "^5.0.0"

The solution

  • [ ] Allow infinity retries, or
  • [ ] Throw error for infinity value

fzn0x avatar Jan 25 '22 11:01 fzn0x

It appears that the option 'forever': true would be more appropriate, however it does not work either.

titanism avatar Jan 31 '23 19:01 titanism

I vote in favour retries: Infinity and some code seems to count with that:

https://github.com/tim-kos/node-retry/blob/11efd6e4e896e06b7873df4f6e187c1e6dd2cf1b/lib/retry.js#L6

but other code doesn't

https://github.com/tim-kos/node-retry/blob/11efd6e4e896e06b7873df4f6e187c1e6dd2cf1b/lib/retry.js#L33

xmedeko avatar Sep 18 '23 16:09 xmedeko