[Client] Implement setMaxRetries connection retries (#413)

* [Client] Implement setMaxRetries connection retries

* [Client] Reject a negative retry count in Configuration

* [Client] Use a positive init timeout in the retry test

* [Client] Drop redundant docblock note on setMaxRetries

* [Client] Clear the initialized flag on a failed connection

* [Client] Trim comments to the non-obvious ones

* [Client] Cover retries and timeout cleanup with integration tests

The retry fixture counts the processes it was started as, which is what
separates a real retry from a second call into the same server. The timeout
fixture outlives the client's patience and then goes idle, so the next
request runs on a connection the client already gave up on once.
This commit is contained in:
Christopher Hertel 2026-08-15 02:43:50 +02:00 • committed by GitHub
commit d8cc21a345
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -96,7 +96,11 @@ final class Builder
}
/**
* Set maximum retry attempts for failed connections.
* Set the number of times a failed connection attempt is retried.
*
* Counts retries, not attempts: 3 means one initial attempt plus up to three
* retries. Pass 0 to fail on the first failure. Only applies to
* {@see Client::connect()}; individual requests are never retried.
*/
public function setMaxRetries(int $retries): self
{