Skip to content

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

@HenriqueSPin

Description

@HenriqueSPin

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)
            )
        );

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions