Skip to content

Retry middleware #281

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 5 commits into
base: main
Choose a base branch
from
Open

Retry middleware #281

wants to merge 5 commits into from

Conversation

teandr
Copy link

@teandr teandr commented Aug 17, 2025

No description provided.

teandr added 3 commits August 17, 2025 15:08
Problem:
The RequestSchedulerInterface was not registered as a singleton/shared in the dependency injection container. Because of this, the Engine received one instance of the scheduler, while the RetryMiddleware received a completely different, new instance. As a result, they operated with separate queues.
@teandr teandr requested a review from ksassnowski as a code owner August 17, 2025 10:03
'retryOnStatus' => [500, 502, 503, 504],
'maxRetries' => 3,
'initialDelay' => 1000,
'delayMultiplier' => 2.0,
Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer if we combined initialDelay and delayMultiplier into a single backoff option that takes an array of integers.

So a backoff of [1, 5, 10] would mean the first retry happens after one second, the second after 5, the third after 10 seconds and 10 seconds for every subsequent request if maxRetries is greater than 3.

Copy link
Author

Choose a reason for hiding this comment

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

Yes, good idea. Implemented.

@ksassnowski
Copy link
Contributor

Thanks for the PR! Looks good overall but I have a few comments that need to be addressed first. Please check them out when you find the time.

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