Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for infinity value in retries #58

Open
2 tasks
fzn0x opened this issue Jan 24, 2022 · 2 comments
Open
2 tasks

Check for infinity value in retries #58

fzn0x opened this issue Jan 24, 2022 · 2 comments

Comments

@fzn0x
Copy link

fzn0x commented Jan 24, 2022

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
Copy link
Author

fzn0x commented Jan 24, 2022

Waiting for your response which solution we should provide, I will kindly open PR for the solution.

@sindresorhus
Copy link
Owner

I agree, it should allow Infinity. However, options are passed to https://github.com/tim-kos/node-retry#retryoperationoptions, so it should be fixed there. Open an issue there instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants