Skip to content

Conversation

@ChrisBr
Copy link

@ChrisBr ChrisBr commented Dec 5, 2025

What was the end-user or developer problem that led to this PR?

Adding exponential backoff to bundler.

  Attempt 1: Initial try (no delay)
     ↓ fails
     Wait: 1.0 - 1.5 seconds (1.0s base + 0-0.5s jitter)
     ↓
  Attempt 2: First retry
     ↓ fails
     Wait: 2.0 - 2.5 seconds (2.0s base + 0-0.5s jitter)
     ↓
  Attempt 3: Second retry

Close #5361

What is your fix for the problem, implemented in this PR?

Close #5361

Make sure the following tasks are checked

Comment on lines 63 to 73
delay = @base_delay * (2 ** (@current_run - 1))
delay = [@max_delay, delay].min
jitter_amount = rand * @jitter
total_delay = delay + jitter_amount
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should extract this to its own method and test this solely, without the sleep part. There are existing tests were sleep is not stubbed and they are now going to take longer to run.

Copy link
Author

Choose a reason for hiding this comment

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

Good point - made it configurable on a class level.

@ChrisBr ChrisBr force-pushed the cbruckmayer/add-exponential-backoff branch from 4f9ca1b to 8806dc1 Compare December 5, 2025 17:09
@ChrisBr ChrisBr force-pushed the cbruckmayer/add-exponential-backoff branch from 8806dc1 to f015c4f Compare December 8, 2025 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bundler should back off exponentially when retrying

3 participants