SocketTimeoutChecker
extends AbstractBackoffStrategy
in package
Custom S3 exponential backoff checking use to retry 400 responses containing the following reason phrase: "Your socket connection to the server was not read from or written to within the timeout period.".
This error has been reported as intermittent/random, and in most cases, seems to occur during the middle of a transfer. This plugin will attempt to retry these failed requests, and if using a local file, will clear the stat cache of the file and set a new content-length header on the upload.
Table of Contents
Constants
- ERR = 'Your socket connection to the server was not read from or written to within the timeout period'
Properties
Methods
- __construct() : mixed
- {@inheridoc}
- getBackoffPeriod() : bool|int
- Get the amount of time to delay in seconds before retrying a request
- getNext() : AbstractBackoffStrategy|null
- Get the next backoff strategy in the chain
- makesDecision() : bool
- {@inheridoc}
- setNext() : mixed
- getDelay() : bool|int|null
- Implement the concrete strategy
Constants
ERR
public
mixed
ERR
= 'Your socket connection to the server was not read from or written to within the timeout period'
Properties
$next
protected
AbstractBackoffStrategy
$next
Next strategy in the chain
Methods
__construct()
{@inheridoc}
public
__construct([BackoffStrategyInterface $next = null ]) : mixed
Parameters
- $next : BackoffStrategyInterface = null
getBackoffPeriod()
Get the amount of time to delay in seconds before retrying a request
public
getBackoffPeriod(mixed $retries, RequestInterface $request[, Response $response = null ][, HttpException $e = null ]) : bool|int
Parameters
- $retries : mixed
-
Number of retries of the request
- $request : RequestInterface
-
Request that was sent
- $response : Response = null
-
Response that was received. Note that there may not be a response
- $e : HttpException = null
-
Exception that was encountered if any
Return values
bool|int —Returns false to not retry or the number of seconds to delay between retries
getNext()
Get the next backoff strategy in the chain
public
getNext() : AbstractBackoffStrategy|null
Return values
AbstractBackoffStrategy|nullmakesDecision()
{@inheridoc}
public
makesDecision() : bool
Return values
boolsetNext()
public
setNext(AbstractBackoffStrategy $next) : mixed
Parameters
- $next : AbstractBackoffStrategy
-
Next strategy in the chain
getDelay()
Implement the concrete strategy
protected
getDelay(mixed $retries, RequestInterface $request[, Response $response = null ][, HttpException $e = null ]) : bool|int|null
Parameters
- $retries : mixed
-
Number of retries of the request
- $request : RequestInterface
-
Request that was sent
- $response : Response = null
-
Response that was received. Note that there may not be a response
- $e : HttpException = null
-
Exception that was encountered if any
Return values
bool|int|null —Returns false to not retry or the number of seconds to delay between retries. Return true or null to defer to the next strategy if available, and if not, return 0.