Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Retry on errors 408 and 504 in RetryDecider

Open
#2,633 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
35/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Tech stack
php
Domain
api, backend

Research direction

Read Core/src/RetryDeciderTrait.php and inspect RetryDecider's existing status-code handling. Add the two listed status codes to the retry list, then verify that 408 and 504 are treated like the existing retryable responses.

Written by the indexing model from the issue text.

Description

type: feature request

Add retry support for 408 and 504 codes per best practices.

API documentation suggests retry logic to handle errors, and indicates the following status codes as ones that should be retried.

  • 408 Request Timeout
  • 500 Internal Server Error
  • 502 Bad Gateway
  • 503 Service Unavailable
  • 504 Gateway Timeout
    [1]

The library currently includes support for this but only with 500, 502, and 503 errors. This leaves out 408 and 504 which requires a custom handler always be implemented to correctly retry all possible error conditions.

    private $httpRetryCodes = [
        500,
        502,
        503
    ];
...
            if (in_array($statusCode, $httpRetryCodes)) {
                return true;
            }

[2]

Adding 408 and 504 to $httpRetryCodes should enable support for this, due to CLA requirements I am unable to open a PR.

Dominant language
PHP
Stars
1.2k
Forks
464
Avg merge
2d 2h
Merged PRs (30d)
103

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from googleapis/google-cloud-php

All issues in googleapis/google-cloud-php

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.