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

feat: lightPush auto retry #2032

Closed
weboko opened this issue Jun 4, 2024 · 3 comments
Closed

feat: lightPush auto retry #2032

weboko opened this issue Jun 4, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@weboko
Copy link
Collaborator

weboko commented Jun 4, 2024

This is a feature request

Problem

It can happen that lightPush.send fail due to not having enough quality peers or peers in general.

Proposed Solutions

Enable following API:

node.lightPush.send(encoder, message, { autoRetry: true }); // retries right after peers are available with default timeout of 500ms 

node.lightPush.send(encoder, message, { autoRetry: { timeout: 1000 } ); // changes timeout to 1s

Default values:

  • autoRetry - false;
  • if autoRetry is true -> { timeout: 500, retries: 3 };
  • in other cases should be merged with provided values;

This feature should be disabled by default as in the worst case scenario it can take some time potentially blocking consumer's app without clear reason.

timeout is to cap execution by await time
retries is to cap execution by amount of tries to .send message to peers

Notes

Original thread - #2003 (comment)

@weboko weboko added the enhancement New feature or request label Jun 4, 2024
@weboko weboko added this to Waku Jun 4, 2024
@weboko weboko moved this to Triage in Waku Jun 5, 2024
@danisharora099
Copy link
Collaborator

Did some optimisations on the original PR and autoRetry was necessitated as part of the functionality:

  • added exponential backoff to blocking
  • reduced the default initialDelay to 10ms
  • reduced the default maxDelay to 100ms
  • provided all options to be changed by the uses through arguments

f97c6a9 should resolve this

@weboko
Copy link
Collaborator Author

weboko commented Jun 27, 2024

Looks good. Is it merged already, @danisharora099 ?

@danisharora099
Copy link
Collaborator

danisharora099 commented Jun 28, 2024

Looks good. Is it merged already, @danisharora099 ?

Yes! This issue can be closed.

Closing now. Feel free to reopen if you think something is left unaddressed

@danisharora099 danisharora099 self-assigned this Jun 28, 2024
@github-project-automation github-project-automation bot moved this from Triage to Done in Waku Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

No branches or pull requests

2 participants