google-api-php-client icon indicating copy to clipboard operation
google-api-php-client copied to clipboard

Batch processing won't retry failures in same way as non-batch requests get retried

Open DeveloperRob opened this issue 10 months ago • 2 comments

When sending a single request (which includes the batch 'wrapper' request), if a number of different errors occur (including rate limiting), {{src/Task/Runner.php}} will by default retry the request following Google's recommended exponential backoff tactic.

However, when making a backup request, it is possible that within the batch there will be a mix of 200 responses and non-200 responses. In this instance, {{execute}} will return an array that contains the valid responses alongside the exceptions.

In the event that the user requires all valid responses before continuing, they need to implement their own userland logic that iterates over the responses, identifies those that failed, and then reattempts a second batch with just the failures (after the backoff delay). Given that the project contains logic for retrying a single request, it would be useful if this was supported (always or optionally) for batch requests.

DeveloperRob avatar Mar 12 '25 08:03 DeveloperRob