Skip to content

Upgrade Watermill to https://github.com/cenkalti/backoff/v5 #570

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

EvanMad
Copy link

@EvanMad EvanMad commented May 19, 2025

Motivation / Background

Watermill currently uses an obsolete version of the Exponential Backoff Go Package. This upgrades Watermill from using v3 to v5.

This upgrade contains multiple breaking changes, but since the API is wrapped inside custom retry middleware we can hide these API changes from the user.

Detail

This requires moving from backoff/v3 MaxElapsedTime to a full backoff/v5 Retry implementation.

IMO, making the retry hook work here is a bit clunky since there is no native way of implementing it, and it needs to be hidden in the operation.

This also bumps the go version in go.mod up to 1.23

Alternative approaches considered (if applicable)

I am aware this conflicts with PR #564.

Happy to move forward with that PR instead if the community decides that is a better approach.

Please also provide feedback on my implementation! I have only been working with Go a few months.

Checklist

The resources of our team are limited. There are a couple of things that you can do to help us merge your PR faster:

  • I wrote tests for the changes.
  • All tests are passing.
    • If you are testing a Pub/Sub, you can start Docker with make up.
    • You can start with make test_short for a quick check.
    • If you want to run all tests, use make test.
  • Code has no breaking changes.
  • (If applicable) documentation on watermill.io is updated.

@EvanMad EvanMad changed the title Upgrade Watermill to exponential backoff v5 Upgrade Watermill to https://github.com/cenkalti/backoff/v5 May 19, 2025
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.

2 participants