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

PendingRequest::handlePromiseResponse - retry ignores delay option in downstream code #54136

Open
HenriqueSPin opened this issue Jan 9, 2025 · 1 comment

Comments

@HenriqueSPin
Copy link

HenriqueSPin commented Jan 9, 2025

Laravel Version

11

PHP Version

8.3.11

Database Driver & Version

No response

Description

When using Http::pool with retry and backoff logic, the requests do not respect the configured delay value.

During debugging, I observed that:

  1. The correct delay value is set at PendingRequest:1082.
  2. The value is propagated properly to Client::transfer.
  3. However, the $handler callback seems to ignore the 'delay' key in $options.

This results in retry attempts not using the expected delay.

Steps To Reproduce

        $urls = collect([ /*...*/ ]);
        Http::pool(
            fn (Pool $pool) => $urls->map(
                fn ($url) => $pool->retry(
                    times: $retries,
                    sleepMilliseconds: $this->getBackoffForAttempt(...),
                    when: $this->shouldRetryRequest(...),
                    throw: false
                )->get($url)
            )
        );
@HenriqueSPin HenriqueSPin changed the title PendingRequest::handlePromiseResponse retry downstream code is ignoring delay option. PendingRequest::handlePromiseResponse - retry ignores delay option in downstream code Jan 9, 2025
Copy link

Thank you for reporting this issue!

As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.

If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants