Skip to content

[HttpClient] Add max_retries setting docs on the RetryableHttpClient #18288

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

Merged
merged 1 commit into from
Jun 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion http_client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,10 @@ making a request. Use the ``max_redirects`` setting to configure this behavior
Retry Failed Requests
~~~~~~~~~~~~~~~~~~~~~

.. versionadded:: 6.3

The ``max_retries`` feature was added in Symfony 6.3.

Sometimes, requests fail because of network issues or temporary server errors.
Symfony's HttpClient allows to retry failed requests automatically using the
:ref:`retry_failed option <reference-http-client-retry-failed>`.
Expand All @@ -714,7 +718,8 @@ By default, failed requests are retried up to 3 times, with an exponential delay
between retries (first retry = 1 second; third retry: 4 seconds) and only for
the following HTTP status codes: ``423``, ``425``, ``429``, ``502`` and ``503``
when using any HTTP method and ``500``, ``504``, ``507`` and ``510`` when using
an HTTP `idempotent method`_.
an HTTP `idempotent method`_. Use the ``max_retries`` setting to configure the amount
of times a request is retried.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
of times a request is retried.
of time a request is retried.


Check out the full list of configurable :ref:`retry_failed options <reference-http-client-retry-failed>`
to learn how to tweak each of them to fit your application needs.
Expand Down