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

rauc: perform retries with exponential backoff #55

Merged
merged 1 commit into from
May 24, 2024

Conversation

hnez
Copy link
Member

@hnez hnez commented Jan 19, 2024

The first poll for updates after a fresh boot usually fails, because the network is not yet up.
This means an update notification will only appear once one polling interval passed since startup (which can be on the order of days).
We could use a heuristic to decide once the network is up so we can start polling, but we are in no hurry and can just wait a bit before the first poll. "A bit" being two minutes in this case because it feels about right.
Edit: the fixed delay was replaced by an exponential backoff that starts at 1min, then 2min, 4min, 8min, 16min, 32min and then the bundle is marked as currently unavailable.

@hnez hnez requested a review from KarlK90 January 19, 2024 12:52
src/dbus/rauc.rs Outdated Show resolved Hide resolved
@hnez hnez force-pushed the rauc-bundle-polling-wait branch from 6f0a559 to f820f42 Compare April 2, 2024 05:35
@hnez hnez changed the title rauc: wait two minutes after startup before polling for updates rauc: perform retries with exponential backoff Apr 2, 2024
@hnez hnez force-pushed the rauc-bundle-polling-wait branch from f820f42 to 50d8b37 Compare April 2, 2024 07:46
@hnez
Copy link
Member Author

hnez commented May 24, 2024

Hi @KarlK90, could you have a second look at this PR?

src/dbus/rauc.rs Show resolved Hide resolved
The first poll for updates after a fresh boot usually fails,
because the network is not yet up.
This means an update notification will only appear once one polling
interval passed since startup (which can be on the order of days).

Retry the polling process with exponential backoff to both recover fast
from short-term issues (like the network not being up yet) and also
prevent the update server from being DDOSed from excessive retries.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
@hnez hnez force-pushed the rauc-bundle-polling-wait branch from 50d8b37 to 9d0e394 Compare May 24, 2024 10:41
@hnez hnez dismissed KarlK90’s stale review May 24, 2024 10:46

I've replaced the hardcoded waiting with retries with exponential backoff

@hnez hnez merged commit 8bc7030 into linux-automation:main May 24, 2024
10 checks passed
@hnez hnez deleted the rauc-bundle-polling-wait branch May 24, 2024 10:52
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