Skip to content

Computed retry delay #664

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

Merged
merged 11 commits into from
Apr 8, 2025
Merged

Computed retry delay #664

merged 11 commits into from
Apr 8, 2025

Conversation

hiroshihorie
Copy link
Member

@hiroshihorie hiroshihorie commented Apr 8, 2025

More sensible retry delay defaults, adopted from the JS SDK.


This pull request focuses on improving the reconnect delay logic in the LiveKit SDK. The main changes include the introduction of a more sophisticated delay computation method, updates to the reconnect options, and enhancements to logging for better traceability.

Improvements to reconnect delay logic:

Enhancements to reconnect options:

Enhancements to retry mechanism:

Copy link

ilo-nanpa bot commented Apr 8, 2025

it seems like you haven't added any nanpa changeset files to this PR.

if this pull request includes changes to code, make sure to add a changeset, by writing a file to .nanpa/<unique-name>.kdl:

minor type="added" "Introduce frobnication algorithm"

refer to the manpage for more information.

@hiroshihorie hiroshihorie requested review from Copilot and ladvoc April 8, 2025 10:49
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Copy link
Contributor

@ladvoc ladvoc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ✅

// First two attempts use fixed delay (0ms, 300ms)
return attempt == 0 ? 0 : baseDelay
} else if attempt < 5 {
// Next 3 attempts use exponential backoff with optional jitter
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

@pblazej pblazej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my local testing, it may help with the ✈️ mode 💯

@hiroshihorie hiroshihorie merged commit 1c2bd16 into main Apr 8, 2025
18 of 19 checks passed
@hiroshihorie hiroshihorie deleted the hiroshi/computed-retry-delay branch April 8, 2025 15:47
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

Successfully merging this pull request may close these issues.

3 participants